Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            var day1 = new Day1();
            var day2 = new Day2();
            var day3 = new Day3();
            var day4 = new Day4();
            var day5 = new Day5();
            var day6 = new Day6();
            var day7 = new Day7();
            var day8 = new Day8();

            ExecuteAndShowTime(day1.Part1, 1, 1);
            ExecuteAndShowTime(day1.Part2, 1, 2);
            ExecuteAndShowTime(day2.Part1, 2, 1);
            ExecuteAndShowTime(day2.Part2, 2, 2);
            ExecuteAndShowTime(day3.Part1, 3, 1);
            ExecuteAndShowTime(day3.Part2, 3, 2);
            ExecuteAndShowTime(day4.Part1, 4, 1);
            ExecuteAndShowTime(day4.Part2, 4, 2);
            ExecuteAndShowTime(day5.Part1, 5, 1);
            ExecuteAndShowTime(day5.Part2, 5, 2);
            ExecuteAndShowTime(day6.Part1, 6, 1);
            ExecuteAndShowTime(day6.Part2, 6, 2);
            ExecuteAndShowTime(day7.Part1, 7, 1);
            ExecuteAndShowTime(day7.Part2, 7, 2);
            ExecuteAndShowTime(day8.Part1, 8, 1);
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            var day7 = new Day7();

            //Console.WriteLine("Day 7-1 : " + day7.AnswerFirstChallenge());
            Console.WriteLine("Day 7-2 : " + day7.AnswerSecondChallenge());
        }
Ejemplo n.º 3
0
        public static void Main(string[] args)
        {
            var stopwatch = new Stopwatch();

            stopwatch.Start();

            //var day1 = new Day1();
            //var day2 = new Day2();
            //var day3 = new Day3();
            //var day4 = new Day4();
            //var day5 = new Day5();
            //var day6 = new Day6();
            var day7 = new Day7();

            //day1.Run();
            //day2.Run();
            //day3.Run();
            //day4.Run();
            //day5.Run();
            //day6.Run();
            day7.Run();

            stopwatch.Stop();

            Console.WriteLine($"Finished running in {stopwatch.ElapsedMilliseconds} ms");
        }
Ejemplo n.º 4
0
        private static void SolveDay7()
        {
            StringData data = new StringData(".\\Data\\Day7a.txt");
            Day7       day  = new Day7(data);

            Console.WriteLine("Day7");
            day.SolveToConsole();
            Console.WriteLine("Press any key to continue");
            Console.ReadKey();
        }
Ejemplo n.º 5
0
        static void Main(string[] args)
        {
            Helper.PrintChallenge("Day 1");
            Day1.Run();

            Helper.PrintChallenge("Day 2");
            Day2.Run();

            Helper.PrintChallenge("Day 3");
            Day3.Run();

            Helper.PrintChallenge("Day 4");
            Day4.Run();

            Helper.PrintChallenge("Day 5");
            Day5.Run();

            Helper.PrintChallenge("Day 6");
            Day6.Run();

            Helper.PrintChallenge("Day 7");
            Day7.Run();

            Helper.PrintChallenge("Day 8");
            Day8.Run();

            Helper.PrintChallenge("Day 9");
            Day9.Run();

            Helper.PrintChallenge("Day 10");
            Day10.Run();

            Helper.PrintChallenge("Day 11");
            Day11.Run();

            Helper.PrintChallenge("Day 12");
            Day12.Run();

            Helper.PrintChallenge("Day 13");
            Day13.Run();

            Helper.PrintChallenge("Day 14");
            Day14.Run();

            Helper.PrintChallenge("Day 15");
            Day15.Run();

            Helper.PrintChallenge("Day 16");
            Day16.Run();

            Helper.PrintChallenge("Day 17");
            Day17.Run();
        }
Ejemplo n.º 6
0
 static void bigDemo()
 {
     Day1.Demo();
     Day2.demo();
     Day3.demo();
     Day4.demo();
     Day5.demo();
     Day6.demo();
     Day7.demo();
     Day8.demo();
     Day9.demo();
 }
Ejemplo n.º 7
0
        public void InitializePuzzle(string path, string cookie, int day)
        {
            Uri uri = new Uri(path);

            using var client = new HttpClient();
            client.DefaultRequestHeaders.Add("Cookie", cookie);
            var response = client.GetStringAsync(uri).Result;

            response.Replace(" ", "");
            string[] values = response.Split("\n");

            if (day == 1)
            {
                Day1.PuzzleA(values);
                Day1.PuzzleB(values);
            }
            if (day == 2)
            {
                Day2.PuzzleA(values);
                Day2.PuzzleB(values);
            }
            if (day == 3)
            {
                Day3.PuzzleA(values);
                Day3.PuzzleB(values);
            }
            if (day == 4)
            {
                Day4.PuzzleA(response);
                Day4.PuzzleB(response);
            }
            if (day == 5)
            {
                Day5.PuzzleA(values);
                Day5.PuzzleB(values);
            }
            if (day == 6)
            {
                Day6.PuzzleA(response);
                Day6.PuzzleB(response);
            }
            if (day == 7)
            {
                Day7.PuzzleA(values);
                Day7.PuzzleB(values);
            }
            if (day == 8)
            {
                Day8.PuzzleA(values);
                Day8.PuzzleB(response);
            }
        }
Ejemplo n.º 8
0
        static void Main(string[] args)
        {
            Console.WriteLine("Day1");
            Day1.Problem1();
            Day1.Problem2();

            Console.WriteLine("Day2");
            Day2.Problem1();
            Day2.Problem2();

            Console.WriteLine("Day3");
            Day3.Problem1();
            Day3.Problem2();

            Console.WriteLine("Day4");
            Day4.Problem1();
            Day4.Problem2();

            Console.WriteLine("Day5");
            Day5.Problem1();
            Day5.Problem2();

            Console.WriteLine("Day6");
            Day6.Problem1();
            Day6.Problem2();

            Console.WriteLine("Day 7");
            Day7.Problem1();
            Day7.Problem2();

            Console.WriteLine("Day 8");
            Day8.Problem1();
            Day8.Problem2();

            Console.WriteLine("Day 9");
            Day9.Problem1();
            Day9.Problem2();

            Console.WriteLine("Day 10");
            Day10.Problem1();
            Day10.Problem2();

            Console.WriteLine("Day 11");
            Day11.Problem1();
            Day11.Problem2();

            Console.WriteLine("Day 12");
            Day12.Problem1();
            Day12.Problem2();

            Console.WriteLine("Day 13");
            Day13.Problem1();
            Day13.Problem2();

            Console.WriteLine("Day 14");
            Day14.Problem1();
            Day14.Problem2();

            Console.WriteLine("Day 15");
            Day15.Problem1();
            //Day15.Problem2();

            Console.WriteLine("Day 16");
            Day16.Problem1();
            Day16.Problem2();
        }
Ejemplo n.º 9
0
 static string RunDay7()
 {
     return(Day7.Run(GetInput(7)).ToString());
 }
Ejemplo n.º 10
0
        //IT WORKS AND I'M TOO LAZY TO ALTER WHAT LOOKED FINE WHEN IT WAS JUST 3 DAYS LONG
        private void Button1_Click(object sender, EventArgs e)
        {
            switch ((int)dayNumber.Value)
            {
            case 1:
                outputBox.Text = "\n- - - - DAY 1 - PART 1 - - - -\n\n" + Day1.PartOneOutput(inputBox.Text);
                break;

            case 2:
                outputBox.Text = "\n- - - - DAY 2 - PART 1 - - - -\n\n" + Day2.PartOneOutput(inputBox.Text);
                break;

            case 3:
                outputBox.Text = "\n- - - - DAY 3 - PART 1 - - - -\n\n" + Day3.PartOneOutput(inputBox.Text);
                break;

            case 4:
                outputBox.Text = "\n- - - - DAY 4 - PART 1 - - - -\n\n" + Day4.PartOneOutput(inputBox.Text);
                break;

            case 5:
                outputBox.Text = "\n- - - - DAY 5 - PART 1 - - - -\n\n" + Day5.PartOneOutput(inputBox.Text);
                break;

            case 6:
                outputBox.Text = "\n- - - - DAY 6 - PART 1 - - - -\n\n" + Day6.PartOneOutput(inputBox.Text);
                break;

            case 7:
                outputBox.Text = "\n- - - - DAY 7 - PART 1 - - - -\n\n" + Day7.PartOneOutput(inputBox.Text);
                break;

            case 8:
                outputBox.Text = "\n- - - - DAY 8 - PART 1 - - - -\n\n" + Day8.PartOneOutput(inputBox.Text);
                break;

            case 9:
                outputBox.Text = "\n- - - - DAY 9 - PART 1 - - - -\n\n" + Day9.PartOneOutput(inputBox.Text);
                break;

            case 10:
                outputBox.Text = "\n- - - - DAY 10 - PART 1 - - - -\n\n" + Day10.PartOneOutput(inputBox.Text);
                break;

            case 11:
                outputBox.Text = "\n- - - - DAY 11 - PART 1 - - - -\n\n" + Day11.PartOneOutput(inputBox.Text);
                break;

            case 12:
                outputBox.Text = "\n- - - - DAY 12 - PART 1 - - - -\n\n" + Day12.PartOneOutput(inputBox.Text);
                break;

            case 13:
                outputBox.Text = "\n- - - - DAY 13 - PART 1 - - - -\n\n" + Day13.PartOneOutput(inputBox.Text);
                break;

            case 14:
                outputBox.Text = "\n- - - - DAY 14 - PART 1 - - - -\n\n" + Day14.PartOneOutput(inputBox.Text);
                break;

            case 15:
                outputBox.Text = "\n- - - - DAY 15 - PART 1 - - - -\n\n" + Day15.PartOneOutput(inputBox.Text);
                break;

            case 16:
                outputBox.Text = "\n- - - - DAY 16 - PART 1 - - - -\n\n" + Day16.PartOneOutput(inputBox.Text);
                break;

            case 17:
                outputBox.Text = "\n- - - - DAY 17 - PART 1 - - - -\n\n" + Day17.PartOneOutput(inputBox.Text);
                break;

            case 18:
                outputBox.Text = "\n- - - - DAY 18 - PART 1 - - - -\n\n" + Day18.PartOneOutput(inputBox.Text);
                break;

            case 19:
                outputBox.Text = "\n- - - - DAY 19 - PART 1 - - - -\n\n" + Day19.PartOneOutput(inputBox.Text);
                break;

            case 20:
                outputBox.Text = "\n- - - - DAY 20 - PART 1 - - - -\n\n" + Day20.PartOneOutput(inputBox.Text);
                break;

            case 21:
                outputBox.Text = "\n- - - - DAY 21 - PART 1 - - - -\n\n" + Day21.PartOneOutput(inputBox.Text);
                break;

            case 22:
                outputBox.Text = "\n- - - - DAY 22 - PART 1 - - - -\n\n" + Day22.PartOneOutput(inputBox.Text);
                break;

            case 23:
                outputBox.Text = "\n- - - - DAY 23 - PART 1 - - - -\n\n" + Day23.PartOneOutput(inputBox.Text);
                break;

            case 24:
                outputBox.Text = "\n- - - - DAY 24 - PART 1 - - - -\n\n" + Day24.PartOneOutput(inputBox.Text);
                break;

            case 25:
                outputBox.Text = "\n- - - - DAY 25 - PART 1 - - - -\n\n" + Day25.PartOneOutput(inputBox.Text);
                break;

            default:
                break;
            }
        }