示例#1
0
        private static void ExecuteDayOne()
        {
            List <int> inputNumbers = DayOne.ReadAndProcessFile();

            int solutionOne = DayOne.FindPartOneSolution(inputNumbers);

            int solutionTwo = DayOne.FindPartTwoSolution(inputNumbers);

            WriteToConsole(solutionOne, solutionTwo);
        }
示例#2
0
        static void Main(string[] args)
        {
            DayOne day = new DayOne();

            DayTwo two = new DayTwo();

            DayThree three = new DayThree();

            Console.WriteLine(new DayFour().CountValid());
        }
示例#3
0
        static void DayOnePartTwo()
        {
            Console.WriteLine("Day 1 Part 2 Output");
            DayOne dayOne = new DayOne();

            DayOne.Result result = dayOne.PartTwo();
            Console.WriteLine(result.currentPosition.ToString());
            Console.WriteLine("Total blocks: " + result.distanceFromOrigin);
            Console.ReadLine();
        }
示例#4
0
        /// <summary>
        /// The main.
        /// </summary>
        /// <param name="args">
        /// The args.
        /// </param>
        public static void Main(string[] args)
        {
Begin:
            Console.WriteLine("   ___       _                      _    _____   __  _____             _            _____  _____  __   _____ \r\n / _ \\     | |                    | |  |  _  | / _|/  __ \\           | |          / __  \\|  _  |/  | |  _  |\r\n/ /_\\ \\  __| |__   __  ___  _ __  | |_ | | | || |_ | /  \\/  ___    __| |  ___     `\' / /\'| |/\' |`| |  \\ V / \r\n|  _  | / _` |\\ \\ / / / _ \\| \'_ \\ | __|| | | ||  _|| |     / _ \\  / _` | / _ \\      / /  |  /| | | |  / _ \\ \r\n| | | || (_| | \\ V / |  __/| | | || |_ \\ \\_/ /| |  | \\__/\\| (_) || (_| ||  __/    ./ /___\\ |_/ /_| |_| |_| |\r\n\\_| |_/ \\__,_|  \\_/   \\___||_| |_| \\__| \\___/ |_|   \\____/ \\___/  \\__,_| \\___|    \\_____/ \\___/ \\___/\\_____/\r\n                                                                                                            \r\n                                                                                                            ");
            Console.WriteLine("==================================================");

Start:
            Console.WriteLine("> Please enter the number of the day you want to solve. (1-2)");
            if (int.TryParse(Console.ReadLine(), out var i))
            {
                switch (i)
                {
                case 1:
                    Console.WriteLine($"> The solution to Day 1 (1/2) is '{DayOne.SolvePartOne()}'");
                    Console.WriteLine($"> The solution to Day 1 (2/2) is '{DayOne.SolvePartTwo()}'");
                    break;

                case 2:
                    Console.WriteLine($"> The solution to Day 2 (1/2) is '{DayTwo.SolvePartOne()}'");
                    Console.WriteLine($"> The solution to Day 2 (2/2) is '{DayTwo.SolvePartTwo()}'");
                    break;

                default:
                    Console.WriteLine("> Invalid day entered.");
                    goto Start;
                }
            }
            else
            {
                Console.WriteLine("> Invalid day entered.");
                goto Start;
            }


            Console.WriteLine("\n> Press any key to view other solutions.");
            Console.ReadKey();
            Console.Clear();
            goto Begin;
        }
示例#5
0
        static void Main(string[] args)
        {
            Console.WriteLine("What day of the advent calender would you like to solve?");
            int advInt;

            int.TryParse(Console.ReadLine(), out advInt);
            switch (advInt)
            {
            default:
                break;

            case 1:
                DayOne.StartProblem();
                break;

            case 2:
                DayTwo.StartProblem();
                break;

            case 3:
                DayThree.StartProblem();
                break;
            }
        }
示例#6
0
        private static int DayOneTwo()
        {
            var inp = InputProvider.DayOne();

            return(DayOne.ProblemTwo(inp));
        }
示例#7
0
        static void Main(string[] args)
        {
            var dayOne = new DayOne();

            Console.WriteLine(dayOne.CalculateSumOfFuel());
        }