예제 #1
0
        public static void Main(string[] args)
        {
            Logger.ShowDebug = false;

            Day01.StartA();
            Day01.StartB();

            Day02.StartA();
            Day02.StartB();

            Day03.StartA();
            Day03.StartB();

            Day04.StartA();
            Day04.StartB();

            Day05.StartA();
            Day05.StartB();

            Logger.ShowDebug = true;

            Day06.StartA();
            Day06.StartB();

            Console.ReadKey();
        }
예제 #2
0
        static void Main(string[] args)
        {
            Day02  day02   = new Day02();
            string program = day02.LoadProgramFromFile();

            day02.LoadProgram(program);

            //before running the program, replace position 1 with the value 12 and replace position 2 with the value 2.
            //day02.WriteMemoryAtAdress(1, 12);
            //day02.WriteMemoryAtAdress(2, 2);
            int  output = 0;
            bool found  = false;
            int  noun   = 0;
            int  verb   = 0;

            for (noun = 0; noun <= 99 && !found; noun++)
            {
                for (verb = 0; verb <= 99 && !found; verb++)
                {
                    day02.SetNoun(noun);
                    day02.SetVerb(verb);
                    day02.RunProgram();

                    output = day02.GetOutput();
                    if (output == 19690720)
                    {
                        found = true;
                    }
                    day02.ResetProgram();
                }
            }

            if (found)
            {
                noun--;
                verb--;
                Console.WriteLine($"Found noun and verb! Noun={noun} Verb={verb}. Solution to puzzle is: {100 * noun + verb}");
            }
            else
            {
                Console.WriteLine("Did not find a noun and a verb!");
            }
        }
예제 #3
0
 static void Main(string[] args)
 {
     Console.WriteLine("---Welcome to erjicle's solutions to Advent of Code 2019!!---");
     // Day 1
     Console.WriteLine($"Day 1 - Part 1: {Day01.GetDay1Part1Answer()}");
     Console.WriteLine($"Day 1 - Part 2: {Day01.GetDay1Part2Answer()}");
     // Day 2
     Console.WriteLine($"Day 2 - Part 1: {Day02.GetDay2Part1Answer()}");
     Console.WriteLine($"Day 2 - Part 2: {Day02.GetDay2Part2Answer()}");
     // Day 3.
     Console.WriteLine($"Day 3 - Part 1: {Day03.GetDay3Part1Answer()}");
     Console.WriteLine($"Day 3 - Part 2: {Day03.GetDay3Part2Answer()}");
     // Day 4
     Console.WriteLine($"Day 4 - Part 1: {Day04.GetDay4Part1Answer()}");
     Console.WriteLine($"Day 4 - Part 2: {Day04.GetDay4Part2Answer()}");
     // Day 5
     Console.WriteLine("Day 5 - Part 1:");
     Day05.RunDay5Part1();
     Console.WriteLine("Day 5 - Part 2:");
     Day05.RunDay5Part2();
     // Day 6
     Console.WriteLine($"Day 6 - Part 1: {Day06.GetDay6Part1Answer()}");
     Console.WriteLine($"Day 6 - Part 2: {Day06.GetDay6Part2Answer()}");
     // Day 7
     Console.WriteLine($"Day 7 - Part 1: {Day07.GetDay7Part1Answer()}");
     Console.WriteLine($"Day 7 - Part 2: {Day07.GetDay7Part2Answer()}");
     // Day 8
     Console.WriteLine($"Day 8 - Part 1: {Day08.GetDay8Part1Answer()}");
     Console.WriteLine($"Day 8 - Part 2:");
     Day08.RunDay8Part2();
     // Day 9
     Console.WriteLine($"Day 9 - Part 1: {Day09.GetDay9Part1Answer()}");
     Console.WriteLine($"Day 9 - Part 2: {Day09.GetDay9Part2Answer()}");
     // Day 10
     Console.WriteLine($"Day 10 - Part 1: {Day10.GetDay10Part1Answer()}");
     Console.WriteLine($"Day 10 - Part 2: {Day10.GetDay10Part2Answer()}");
     // Day 11
     Console.WriteLine($"Day 11 - Part 1: {Day11.GetDay11Part1Answer()}");
     Console.WriteLine($"Day 11 - Part 2: {Day11.RunDay11Part2()}");
     // Day 12
     Console.WriteLine($"Day 12 - Part 1: {Day12.GetDay12Part1Answer()}");
     Console.WriteLine($"Day 12 - Part 2: {Day12.GetDay12Part2Answer()}");
     // Day 13
     Console.WriteLine($"Day 13 - Part 1: {Day13.GetDay13Part1Answer()}");
     Console.WriteLine($"Day 13 - Part 2: {Day13.GetDay13Part2Answer()}");
     // Day 14
     Console.WriteLine($"Day 14 - Part 1: {Day14.GetDay14Part1Answer()}");
     Console.WriteLine($"Day 14 - Part 2: {Day14.GetDay14Part2Answer()}");
     // Day 15
     Console.WriteLine($"Day 15 - Part 1: {Day15.GetDay15Part1Answer()}");
     Console.WriteLine($"Day 15 - Part 2: {Day15.GetDay15Part2Answer()}");
     // Day 16
     Console.WriteLine($"Day 16 - Part 1: {Day16.GetDay16Part1Answer()}");
     Console.WriteLine($"Day 16 - Part 2: {Day16.GetDay16Part2Answer()}");
     // Day 17
     Console.WriteLine($"Day 17 - Part 1: {Day17.GetDay17Part1Answer()}");
     Console.WriteLine($"Day 17 - Part 2: {Day17.GetDay17Part2Answer()}");
     // Day 18
     Console.WriteLine($"Day 18 - Part 1: {Day18.GetDay18Part1Answer()}");
     Console.WriteLine($"Day 18 - Part 2: {Day18.GetDay18Part2Answer()}");
     // Day 19
     Console.WriteLine($"Day 19 - Part 1: {Day19.GetDay19Part1Answer()}");
     Console.WriteLine($"Day 19 - Part 2: {Day19.GetDay19Part2Answer()}");
     // Day 20
     Console.WriteLine($"Day 20 - Part 1: {Day20.GetDay20Part1Answer()}");
     Console.WriteLine($"Day 20 - Part 2: {Day20.GetDay20Part2Answer()}");
     // Day 21
     Console.WriteLine($"Day 21 - Part 1: {Day21.GetDay21Part1Answer()}");
     Console.WriteLine($"Day 21 - Part 2: {Day21.GetDay21Part2Answer()}");
     // Day 22
     Console.WriteLine($"Day 22 - Part 1: {Day22.GetDay22Part1Answer()}");
     Console.WriteLine($"Day 22 - Part 2: {Day22.GetDay22Part2Answer()}");
     // Day 23
     Console.WriteLine($"Day 23 - Part 1: {Day23.GetDay23Part1Answer()}");
     Console.WriteLine($"Day 23 - Part 2: {Day23.GetDay23Part2Answer()}");
     // Day 24
     Console.WriteLine($"Day 24 - Part 1: {Day24.GetDay24Part1Answer()}");
     Console.WriteLine($"Day 24 - Part 2 Test: {Day24.GetDay24Part2AnswerTest()}");
     Console.WriteLine($"Day 24 - Part 2: {Day24.GetDay24Part2Answer()}");
     // Day 24
     Console.WriteLine($"Day 25 - Part 1: {Day25.GetDay25Part1Answer()}");
 }
예제 #4
0
        static void Main(string[] args)
        {
            while (true)
            {
                Console.WriteLine("*******************");
                Console.WriteLine("Advent of Code 2019");
                Console.WriteLine("*******************");
                Console.WriteLine();
                Console.Write("Run day: ");
                int dayToRun = int.Parse(Console.ReadLine());

                switch (dayToRun)
                {
                case 1:
                    Day01.Run();
                    break;

                case 2:
                    Day02.Run();
                    break;

                case 3:
                    Day03.Run();
                    break;

                case 4:
                    Day04.Run();
                    break;

                case 5:
                    Day05.Run();
                    break;

                case 6:
                    Day06.Run();
                    break;

                case 7:
                    Day07.Run();
                    break;

                case 8:
                    Day08.Run();
                    break;

                case 9:
                    Day09.Run();
                    break;

                case 10:
                    Day10.Run();
                    break;

                case 11:
                    Day11.Run();
                    break;

                case 12:
                    Day12.Run();
                    break;

                case 13:
                    Day13.Run();
                    break;

                case 14:
                    Day14.Run();
                    break;

                case 15:
                    Day15.Run();
                    break;

                case 16:
                    Day16.Run();
                    break;

                case 17:
                    Day17.Run();
                    break;

                case 18:
                    Day18.Run();
                    break;

                case 19:
                    Day19.Run();
                    break;

                case 20:
                    Day20.Run();
                    break;

                case 21:
                    Day21.Run();
                    break;

                case 22:
                    Day22.Run();
                    break;

                case 23:
                    Day23.Run();
                    break;

                case 24:
                    Day24.Run();
                    break;

                case 25:
                    Day25.Run();
                    break;
                }
                Console.WriteLine();
            }
        }