Ejemplo n.º 1
0
    public static void Main()
    {
        var sizes = AOC.ParseInts(File.ReadAllText(@"..\..\inputs\17.txt"))
                    .OrderByDescending(s => s).ToList();

        Part1(sizes);
        Part2(sizes);
    }
Ejemplo n.º 2
0
    public static void Main()
    {
        var lines       = File.ReadAllLines(@"..\..\inputs\15.txt");
        var ingredients = new List <Ingredient>();

        foreach (var line in lines)
        {
            var nums = AOC.ParseInts(line);
            ingredients.Add(new Ingredient(nums[0], nums[1], nums[2], nums[3], nums[4]));
        }

        Part1(ingredients);
        Part2(ingredients);
    }
Ejemplo n.º 3
0
    public static void Main()
    {
        var lines = File.ReadAllLines(@"..\..\inputs\14.txt");
        var stats = new List <ReindeerSpecs>();

        foreach (var line in lines)
        {
            var nums   = AOC.ParseInts(line);
            var speed  = Convert.ToInt32(nums[0]);
            var length = Convert.ToInt32(nums[1]);
            var rest   = Convert.ToInt32(nums[2]);
            stats.Add(new ReindeerSpecs(speed, length, rest));
        }

        Part1(stats);
        Part2(stats);
    }
Ejemplo n.º 4
0
    public static void Main()
    {
        var input = File.ReadAllText(@"..\..\inputs\21.txt");
        var ints  = AOC.ParseInts(input);
        var boss  = new FighterStat {
            Hp     = ints[0],
            Damage = ints[1],
            Armor  = ints[2]
        };

        var weapons = new List <Item> {
            new Item(8, 4, 0),
            new Item(10, 5, 0),
            new Item(25, 6, 0),
            new Item(40, 7, 0),
            new Item(74, 8, 0)
        };

        var armor = new List <Item> {
            new Item(13, 0, 1),
            new Item(31, 0, 2),
            new Item(53, 0, 3),
            new Item(75, 0, 4),
            new Item(102, 0, 5)
        };

        var rings = new List <Item> {
            new Item(25, 1, 0),
            new Item(50, 2, 0),
            new Item(100, 3, 0),
            new Item(20, 0, 1),
            new Item(40, 0, 2),
            new Item(80, 0, 3)
        };

        Part1(boss, weapons, armor, rings);
        Part2(boss, weapons, armor, rings);
    }
Ejemplo n.º 5
0
    public static void Main()
    {
        var nums = AOC.ParseInts(File.ReadAllText(@"..\..\inputs\22.txt"));

        // var bossStats = new FighterStats(14, 8, 0, 0);
        var bossStats = new FighterStats(nums[0], nums[1], 0, 0);

        var spells = new List <Spell> {
            new Spell("Magic missile", 53, 4, 0, null), // Magic missile
            new Spell("Drain", 73, 2, 2, null),         // Drain
            new Spell("Shield", 113, 0, 0, new Effect {
                ID = 1, Duration = 6, Armor = 7
            }),                                                                             // Shield
            new Spell("Poison", 173, 0, 0, new Effect {
                ID = 2, Duration = 6, Damage = 3
            }),                                                                              // Poison
            new Spell("Recharge", 229, 0, 0, new Effect {
                ID = 3, Duration = 5, Mana = 101
            }),                                                                                // Recharge
        };

        Part1(bossStats, spells);
        Part2(bossStats, spells);
    }