Example #1
0
        private static void Main(string[] args)
        {
            int  currentDayNumber = 15;
            IDay currentDay       = null;

            switch (currentDayNumber)
            {
            case 1: currentDay = new Day01(); break;

            case 2: currentDay = new Day02(); break;

            case 3: currentDay = new Day03(); break;

            case 4: currentDay = new Day04(); break;

            case 5: currentDay = new Day05(); break;

            case 6: currentDay = new Day06(); break;

            case 7: currentDay = new Day07(); break;

            case 8: currentDay = new Day08(); break;

            case 9: currentDay = new Day09(); break;

            case 10: currentDay = new Day10(); break;

            case 11: currentDay = new Day11(); break;

            case 12: currentDay = new Day12(); break;

            case 13: currentDay = new Day13(); break;

            case 14: currentDay = new Day14(); break;

            case 15: currentDay = new Day15(); break;

            case 23: currentDay = new Day23(); break;
            }

            string[] linesDay    = File.ReadAllLines(string.Format("inputs/Day{0:00}.txt", currentDayNumber));
            string   resultPart1 = currentDay.ResolvePart1(linesDay);

            Console.WriteLine("Day{1:00} Result Part1: {0}", resultPart1, currentDayNumber);
            string resultPart2 = currentDay.ResolvePart2(linesDay);

            Console.WriteLine("Day{1:00} Result Part2: {0}", resultPart2, currentDayNumber);

            Console.Read();
        }
Example #2
0
        static void Main(string[] args)
        {
            while (true)
            {
                Console.WriteLine("*******************");
                Console.WriteLine("Advent of Code 2018");
                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();
            }
        }