static void Main(string[] args) { Console.WriteLine($"Day 1, part 2: {Day1.Part2()}"); Console.WriteLine($"Day 2, part 1: {Day2.Part1()}"); Console.WriteLine($"Day 2, part 2: {Day2.Part2()}"); Console.Read(); }
static void Main(string[] args) { while (true) { Console.Clear(); Console.WriteLine("Choose day to run:"); foreach (var day in Enumerable.Range(1, 24)) { Console.WriteLine($"Day: {day}"); } var input = Console.ReadLine(); switch (input) { case "1": Console.Clear(); Day1.Run(); break; case "2": Console.Clear(); Day2.Run(); break; } Console.ReadKey(); } }
static void Main(string[] args) { ////Day 1 Tuple <int, int> result = Day1.Execute(D1_FILE_PATH); Console.WriteLine($"Day 1 results are: {result}\n"); ////Day2 Tuple <int, int> d2Result = Day2.Execute(D2_FILE_PATH); Console.WriteLine($"Day 2 results are {d2Result}\n"); ////Day 3 Tuple <int, long> d3Result = Day3.Execute(D3_FILE_PATH); Console.WriteLine($"Day 3 results are: {d3Result}\n"); ////Day4 Tuple <int, int> d4Result = Day4.Execute(D4_FILE_PATH); Console.WriteLine($"Day 4 results are: {d4Result}\n"); ////Day5 Tuple <int, int> d5Results = Day5.Execute(D5_FILE_PATH); Console.WriteLine($"Day 5 results are: {d5Results}\n"); //Day6 Tuple <int, int> d6Results = Day6.Execute(D6_FILE_PATH); Console.WriteLine($"Day 6 results are: {d6Results}\n"); }
static void Main(string[] args) { bool repeat = true; Console.WriteLine("ADVENT OF CODE 2016"); while (repeat) { Console.Write("Select day(1-25): "); string day = Console.ReadLine(); switch (day) { case "1": Day1 day1 = new Day1(); day1.Run(); break; case "0": repeat = false; break; default: break; } } Console.WriteLine("hej då"); Console.ReadKey(); }
static void Main(string[] args) { Console.WriteLine("Day 1 result A: " + Day1.runSolutionA()); Console.WriteLine("Day 1 result B: " + Day1.runSolutionB()); Console.WriteLine("Day 2 result A: " + Day2.runSolutionA()); Console.WriteLine("Day 2 result B: " + Day2.runSolutionB()); Console.ReadLine(); }
static void Main(string[] args) { Console.WriteLine("Hello World!"); Day1.Solve(); Day2.Solve(); Day3.Solve(); Console.Read(); }
static void day1Adventure() { Day1 day1 = new Day1(); string[] data = utils.FileUtils.ReadFileData(Consts.dataDay1); int[] numberList = day1.ConvertToIntArray(data); Console.WriteLine("First frequency twice: {0}", day1.FirstFrequencyTwice(numberList, 0)); }
static void Main(string[] args) { Console.WriteLine($"Day 1: {Day1.Solve()}"); Console.WriteLine($"Day 2: {Day2.Solve()}"); Console.WriteLine($"Day 3: {Day3.Solve()}"); Console.WriteLine($"Day 4: {Day4.Solve()}"); Console.WriteLine($"Day 5: {string.Join(", ", Day5.Solve())}"); Console.WriteLine($"Day 6: {Day6.Solve()}"); }
static void Main(string[] args) { Console.WriteLine(string.Format("Day 1 Part 1: {0}", Day1.Part1())); Console.WriteLine(string.Format("Day 1 Part 2: {0}", Day1.Part2())); Console.WriteLine(); Console.WriteLine(string.Format("Day 2 Part 1: {0}", Day2.Part1())); Console.WriteLine(string.Format("Day 2 Part 2: {0}", Day2.Part2())); Console.WriteLine(); Console.WriteLine(string.Format("Day 3 Part 1: {0}", Day3.Part1())); //Console.WriteLine(string.Format("Day 3 Part 2: {0}", Day3.Part2())); Console.ReadKey(); }
static void Main(string[] args) { var day1 = new Day1(); var day2 = new Day2(); Console.WriteLine("----------------Advent of Code------------"); Console.WriteLine("---------------------Day 1----------------"); Console.WriteLine("Puzzle 1 output: {0}", day1.SolvePuzzle1()); Console.WriteLine("Puzzle 2 output: {0}", day1.SolvePuzzle2()); Console.WriteLine("---------------------Day 2----------------"); Console.WriteLine("Puzzle 1 output: {0}", day2.SolvePuzzle1()); Console.WriteLine("Puzzle 2 output: {0}", day2.SolvePuzzle2()); Console.ReadLine(); }
static void SolveDay1() { // TODO: dependancy injection var adventClient = new AdventHttpClient(); var adventInput = new AdventInputProvider(adventClient); var day1 = new Day1(adventInput); var frequency = day1.CalculateFrequency().Result; Console.WriteLine($"Day 1 frequency: {frequency}"); var duplicateFrequency = day1.GetFirstFrequencyDuplication().Result; Console.WriteLine($"Day 1 frequency duplication: {duplicateFrequency}"); }
static void Main() { Stopwatch stopWatch = new Stopwatch(); stopWatch.Start(); var dataHandler = new DataHandler(); var selectedDay = new Day1(dataHandler); selectedDay.ReadData(); var answerPart1 = selectedDay.SolvePart1(); Console.WriteLine($"Answer to part 1: {answerPart1}"); var answerPart2 = selectedDay.SolvePart2(); Console.WriteLine($"Answer to part 2: {answerPart2}"); stopWatch.Stop(); Console.WriteLine($"Milliseconds: {stopWatch.ElapsedMilliseconds}"); }
private static void Main(string[] args) { var day1 = new Day1(); PrintResult(day1); var day2 = new Day2(); PrintResult(day2); var day3 = new Day3(); PrintResult(day3); var day4 = new Day4(); PrintResult(day4); Console.ReadLine(); }
static void Main(string[] args) { Day1 day1 = new Day1(); Day2 day2 = new Day2(); Day3 day3 = new Day3(); Day4 day4 = new Day4(); Day5 day5 = new Day5(); Day6 day6 = new Day6(); Day7 day7 = new Day7(); Day8 day8 = new Day8(); //day1.Run(); //day2.Run(); //day3.Run(); //day4.Run(); //day5.Run(); //day6.Run(); day7.Run(); //day8.Run(); }
static void Main(string[] args) { Console.WriteLine("Welcome to Ruchi's solution to Advent of Code Challenges. To select the Solution of a specific day please enter a number out of the following range: 1-1.\n\nEnter 0 to EXIT."); string input = Console.ReadLine(); while (Convert.ToInt32(input) != 0) { if (Convert.ToInt32(input) == 1) { string[] lines = System.IO.File.ReadAllLines(@"D:\AoC-GitHub\amherst-aoc-2019\Ruchi\AdventOfCode\inputForDay1.txt"); double ouputPart1 = 0; foreach (var line in lines) { ouputPart1 += Day1.CalculateFuel(Convert.ToDouble(line)); } Console.WriteLine("\nPart 1 result: " + ouputPart1); double ouputPart2 = 0; foreach (string line in lines) { double result = Day1.CalculateFuel(Convert.ToDouble(line)); ouputPart2 += result > 0 ? result : 0; while (result > 0) { result = Day1.CalculateFuel(Convert.ToDouble(result)); ouputPart2 += result > 0 ? result : 0; } } Console.WriteLine("Part 2 result: " + ouputPart2); } Console.WriteLine("\n\nTo select the Solution of a specific day please enter a number out of the following range: 1-1.\n\nEnter 0 to EXIT."); input = Console.ReadLine(); } }
static void Main(string[] args) { Day1 d1 = new Day1(); Console.WriteLine((int)d1.SolvePart1()); Console.WriteLine((int)d1.SolvePart2()); Day2 d2 = new Day2(); Console.WriteLine((int)d2.SolvePart1()); Console.WriteLine((int)d2.SolvePart2()); Day3 d3 = new Day3(); Console.WriteLine((int)d3.SolvePart1()); Console.WriteLine((int)d3.SolvePart2()); Day4 d4 = new Day4(); Console.WriteLine((int)d4.SolvePart1()); Console.Write("Press any key to exit"); Console.ReadKey(); }
static void Main(string[] args) { string UserSelection = ""; bool ContinueLoop = true; do { // Ask for userinput to select problem 1-25 // Select Test Input or Input Console.WriteLine("Please select a Day Number(1-25): "); UserSelection = Console.ReadLine(); string PartSelection = ""; string TestSelection = ""; switch (UserSelection) { case "1": Console.WriteLine("Please Select Part Number 1 or 2: "); PartSelection = Console.ReadLine(); switch (PartSelection) { case "1": Console.WriteLine("Please Select Input or Test Input 1 or 2: "); TestSelection = Console.ReadLine(); switch (TestSelection) { case "1": Console.WriteLine(Day1.Part1(ReadFile("Input/Problem1.txt"))); break; case "2": Console.WriteLine(Day1.Part1(ReadFile("TestInput/Problem1.txt"))); break; } break; case "2": Console.WriteLine("Please Select Input or Test Input 1 or 2: "); TestSelection = Console.ReadLine(); switch (TestSelection) { case "1": Console.WriteLine(Day1.Part2(ReadFile("Input/Problem1.txt"))); break; case "2": Console.WriteLine(Day1.Part2(ReadFile("TestInput/Problem1.txt"))); break; } break; } break; case "2": Console.WriteLine("Please Select Part Number 1 or 2: "); PartSelection = Console.ReadLine(); switch (PartSelection) { case "1": Console.WriteLine("Please Select Input or Test Input 1 or 2: "); TestSelection = Console.ReadLine(); switch (TestSelection) { case "1": Console.WriteLine(Day2.Part1(ReadFile("Input/Problem2.txt"))); break; case "2": Console.WriteLine(Day2.Part1(ReadFile("TestInput/Problem2.txt"))); break; } break; case "2": Console.WriteLine("Please Select Input or Test Input 1 or 2: "); TestSelection = Console.ReadLine(); switch (TestSelection) { case "1": Console.WriteLine(Day2.Part2(ReadFile("Input/Problem2.txt"))); break; case "2": Console.WriteLine(Day2.Part2(ReadFile("TestInput/Problem2.txt"))); break; } break; } break; case "3": Console.WriteLine("Please Select Part Number 1 or 2: "); PartSelection = Console.ReadLine(); switch (PartSelection) { case "1": Console.WriteLine("Please Select Input or Test Input 1 or 2: "); TestSelection = Console.ReadLine(); switch (TestSelection) { case "1": Console.WriteLine(Day3.Part1(ReadFile("Input/Problem3.txt"))); break; case "2": Console.WriteLine(Day3.Part1(ReadFile("TestInput/Problem3.txt"))); break; } break; case "2": Console.WriteLine("Please Select Input or Test Input 1 or 2: "); TestSelection = Console.ReadLine(); switch (TestSelection) { case "1": Console.WriteLine(Day3.Part2(ReadFile("Input/Problem3.txt"))); break; case "2": Console.WriteLine(Day3.Part2(ReadFile("TestInput/Problem3.txt"))); break; } break; } break; case "4": Console.WriteLine("Please Select Part Number 1 or 2: "); PartSelection = Console.ReadLine(); switch (PartSelection) { case "1": Console.WriteLine("Please Select Input or Test Input 1 or 2: "); TestSelection = Console.ReadLine(); switch (TestSelection) { case "1": Console.WriteLine(Day4.Part1(ReadFile("Input/Problem4.txt"))); break; case "2": Console.WriteLine(Day4.Part1(ReadFile("TestInput/Problem4.txt"))); break; } break; case "2": Console.WriteLine("Please Select Input or Test Input 1 or 2: "); TestSelection = Console.ReadLine(); switch (TestSelection) { case "1": Console.WriteLine(Day4.Part2(ReadFile("Input/Problem4.txt"))); break; case "2": Console.WriteLine(Day4.Part2(ReadFile("TestInput/Problem4.txt"))); break; } break; } break; case "5": Console.WriteLine("Please Select Part Number 1 or 2: "); PartSelection = Console.ReadLine(); switch (PartSelection) { case "1": Console.WriteLine("Please Select Input or Test Input 1 or 2: "); TestSelection = Console.ReadLine(); switch (TestSelection) { case "1": Console.WriteLine(Day5.Part1(ReadFile("Input/Problem5.txt"))); break; case "2": Console.WriteLine(Day5.Part1(ReadFile("TestInput/Problem5.txt"))); break; } break; case "2": Console.WriteLine("Please Select Input or Test Input 1 or 2: "); TestSelection = Console.ReadLine(); switch (TestSelection) { case "1": Console.WriteLine(Day5.Part2(ReadFile("Input/Problem5.txt"))); break; case "2": Console.WriteLine(Day5.Part2(ReadFile("TestInput/Problem5.txt"))); break; } break; } break; case "6": Console.WriteLine("Please Select Part Number 1 or 2: "); PartSelection = Console.ReadLine(); switch (PartSelection) { case "1": Console.WriteLine("Please Select Input or Test Input 1 or 2: "); TestSelection = Console.ReadLine(); switch (TestSelection) { case "1": Console.WriteLine(Day6.Part1(ReadFile("Input/Problem6.txt"))); break; case "2": Console.WriteLine(Day6.Part1(ReadFile("TestInput/Problem6.txt"))); break; } break; case "2": Console.WriteLine("Please Select Input or Test Input 1 or 2: "); TestSelection = Console.ReadLine(); switch (TestSelection) { case "1": Console.WriteLine(Day6.Part2(ReadFile("Input/Problem6.txt"))); break; case "2": Console.WriteLine(Day6.Part2(ReadFile("TestInput/Problem6.txt"))); break; } break; } break; case "7": Console.WriteLine("Please Select Part Number 1 or 2: "); PartSelection = Console.ReadLine(); switch (PartSelection) { case "1": Console.WriteLine("Please Select Input or Test Input 1 or 2: "); TestSelection = Console.ReadLine(); switch (TestSelection) { case "1": Console.WriteLine(Day7.Part1(ReadFile("Input/Problem7.txt"))); break; case "2": Console.WriteLine(Day7.Part1(ReadFile("TestInput/Problem7.txt"))); break; } break; case "2": Console.WriteLine("Please Select Input or Test Input 1 or 2: "); TestSelection = Console.ReadLine(); switch (TestSelection) { case "1": Console.WriteLine(Day7.Part2(ReadFile("Input/Problem7.txt"))); break; case "2": Console.WriteLine(Day7.Part2(ReadFile("TestInput/Problem7.txt"))); break; } break; } break; case "8": Console.WriteLine("Please Select Part Number 1 or 2: "); PartSelection = Console.ReadLine(); switch (PartSelection) { case "1": Console.WriteLine("Please Select Input or Test Input 1 or 2: "); TestSelection = Console.ReadLine(); switch (TestSelection) { case "1": Console.WriteLine(Day8.Part1(ReadFile("Input/Problem8.txt"))); break; case "2": Console.WriteLine(Day8.Part1(ReadFile("TestInput/Problem8.txt"))); break; } break; case "2": Console.WriteLine("Please Select Input or Test Input 1 or 2: "); TestSelection = Console.ReadLine(); switch (TestSelection) { case "1": Console.WriteLine(Day8.Part2(ReadFile("Input/Problem8.txt"))); break; case "2": Console.WriteLine(Day8.Part2(ReadFile("TestInput/Problem8.txt"))); break; } break; } break; case "9": Console.WriteLine("Please Select Part Number 1 or 2: "); PartSelection = Console.ReadLine(); switch (PartSelection) { case "1": Console.WriteLine("Please Select Input or Test Input 1 or 2: "); TestSelection = Console.ReadLine(); switch (TestSelection) { case "1": Console.WriteLine(Day9.Part1(ReadFile("Input/Problem9.txt"))); break; case "2": Console.WriteLine(Day9.Part1(ReadFile("TestInput/Problem9.txt"))); break; } break; case "2": Console.WriteLine("Please Select Input or Test Input 1 or 2: "); TestSelection = Console.ReadLine(); switch (TestSelection) { case "1": Console.WriteLine(Day9.Part2(ReadFile("Input/Problem9.txt"))); break; case "2": Console.WriteLine(Day9.Part2(ReadFile("TestInput/Problem9.txt"))); break; } break; } break; case "10": Console.WriteLine("Please Select Part Number 1 or 2: "); PartSelection = Console.ReadLine(); switch (PartSelection) { case "1": Console.WriteLine("Please Select Input or Test Input 1 or 2: "); TestSelection = Console.ReadLine(); switch (TestSelection) { case "1": Console.WriteLine(Day10.Part1(ReadFile("Input/Problem10.txt"))); break; case "2": Console.WriteLine(Day10.Part1(ReadFile("TestInput/Problem10.txt"))); break; } break; case "2": Console.WriteLine("Please Select Input or Test Input 1 or 2: "); TestSelection = Console.ReadLine(); switch (TestSelection) { case "1": Console.WriteLine(Day10.Part2(ReadFile("Input/Problem10.txt"))); break; case "2": Console.WriteLine(Day10.Part2(ReadFile("TestInput/Problem10.txt"))); break; } break; } break; case "X": case "x": ContinueLoop = false; break; default: Console.WriteLine("Sorry please select a number between 1-25"); break; } }while(ContinueLoop == true); // Day 1 // Day 2 // Console.WriteLine(Day2.Part1(ReadFile("Input/Problem2.txt"))); // Console.WriteLine(Day2.Part2(ReadFile("Input/Problem2.txt"))); // Console.WriteLine(Day2.Part1(ReadFile("TestInput/Problem2.txt"))); // Console.WriteLine(Day2.Part2(ReadFile("TestInput/Problem2.txt"))); // Day 3 // Console.WriteLine(Day3.Part1(ReadFile("Input/Problem3.txt"))); // Console.WriteLine(Day3.Part2(ReadFile("Input/Problem3.txt"))); // Console.WriteLine(Day3.Part1(ReadFile("TestInput/Problem3.txt"))); // Console.WriteLine(Day3.Part2(ReadFile("TestInput/Problem3.txt"))); // Day 4 // Console.WriteLine(Day4.Part1(ReadFile("Input/Problem4.txt"))); // Console.WriteLine(Day4.Part2(ReadFile("Input/Problem4.txt"))); // Console.WriteLine(Day4.Part1(ReadFile("TestInput/Problem4.txt"))); // Console.WriteLine(Day4.Part2(ReadFile("TestInput/Problem4.txt"))); // Day 5 // Console.WriteLine(Day5.Part1(ReadFile("Input/Problem5.txt"))); // Console.WriteLine(Day5.Part2(ReadFile("Input/Problem5.txt"))); // Console.WriteLine(Day5.Part1(ReadFile("TestInput/Problem5.txt"))); // Console.WriteLine(Day5.Part2(ReadFile("TestInput/Problem5.txt"))); // Day 6 // Console.WriteLine(Day6.Part1(ReadFile("Input/Problem6.txt"))); // Console.WriteLine(Day6.Part2(ReadFile("Input/Problem6.txt"))); // Console.WriteLine(Day6.Part1(ReadFile("TestInput/Problem6.txt"))); // Console.WriteLine(Day6.Part2(ReadFile("TestInput/Problem6.txt"))); // Day 7 // Console.WriteLine(Day7.Part1(ReadFile("Input/Problem7.txt"))); // Console.WriteLine(Day7.Part2(ReadFile("Input/Problem7.txt"))); // Console.WriteLine(Day7.Part1(ReadFile("TestInput/Problem7.txt"))); // Console.WriteLine(Day7.Part2(ReadFile("TestInput/Problem7.txt"))); // Day 8 // Console.WriteLine(Day8.Part1(ReadFile("Input/Problem8.txt"))); // Console.WriteLine(Day8.Part2(ReadFile("Input/Problem8.txt"))); // Console.WriteLine(Day8.Part1(ReadFile("TestInput/Problem8.txt"))); // Console.WriteLine(Day8.Part2(ReadFile("TestInput/Problem8.txt"))); // Day 9 // Console.WriteLine(Day9.Part1(ReadFile("Input/Problem9.txt"))); // Console.WriteLine(Day9.Part2(ReadFile("Input/Problem9.txt"))); // Console.WriteLine(Day9.Part1(ReadFile("TestInput/Problem9.txt"))); // Console.WriteLine(Day9.Part2(ReadFile("TestInput/Problem9.txt"))); // Day 10 // Console.WriteLine(Day10.Part1(ReadFile("Input/Problem10.txt"))); // Console.WriteLine(Day10.Part2(ReadFile("Input/Problem10.txt"))); // Console.WriteLine(Day10.Part1(ReadFile("TestInput/Problem10.txt"))); // Console.WriteLine(Day10.Part2(ReadFile("TestInput/Problem10.txt"))); }
public static void Main(string[] args) { if (args.Length < 1) { Console.WriteLine("Hello World!"); } else { switch (args[0]) { case "p1": Day1.FirstPuzzle(args.Skip(1).Select(int.Parse).ToArray()); break; case "p2": Day1.SecondPuzzle(args.Skip(1).Select(int.Parse).ToArray()); break; case "p3": Day2.ThirdPuzzle(args[1]); break; case "p4": Day2.FourthPuzzle(args[1]); break; case "p5": Day3.FifthPuzzle(args[1], args[2]); break; case "p6": Day3.SixthPuzzle(args[1], args[2]); break; case "p7": Day4.SeventhPuzzle(args[1]); break; case "p8": Day4.EigthPuzzle(args[1]); break; case "p9": Day5.NinthPuzzle(args[1]); break; case "p10": Day5.TenthPuzzle(args[1]); break; case "p11": Day6.EleventhPuzzle(args.Skip(1).ToArray()); break; case "p12": Day6.TwelthPuzzle(args.Skip(1).ToArray()); break; case "p13": Day7.ThirteenthPuzzle(args[1]); break; case "p14": Day7.FourteenthPuzzle(args[1]); break; case "p15": Day8.FifteenthPuzzle(args[1]); break; case "p16": Day8.SixteenthPuzzle(args[1]); break; case "p17": case "p18": Day9.SeventeenthPuzzle(args[1]); break; case "p19": Day10.NineteenthPuzzle(args.Skip(1).ToArray()); break; case "p20": Day10.TwentiethPuzzle(args.Skip(1).ToArray()); break; case "p21": Day11.TwentyfirstPuzzle(args[1]); break; case "p22": Day11.TwentysecondPuzzle(args[1]); break; case "p23": Day12.TwentythirdPuzzle(); break; case "p24": Day12.TwentyfourthPuzzle(); break; case "p25": Day13.TwentyfifthPuzzle(args[1]); break; case "p26": Day13.TwentysixthPuzzle(args[1]); break; case "p27": Day14.TwentyseventhPuzzle(); break; case "p28": Day14.TwentyeighthPuzzle(); break; default: Console.WriteLine("Hello World!"); break; } } }
private void buttonDay1_Click(object sender, EventArgs e) { Day1 dialog = new Day1(); dialog.ShowDialog(); }
static void PrintSolution(int day) { switch (day) { case 1: Console.WriteLine("\nSolving Day 1...."); Console.WriteLine($"Solution to part 1: {Day1.SolvePart1()}\n"); Console.WriteLine($"Solution to part 2: {Day1.SolvePart2()}\n"); break; case 2: Console.WriteLine("\nSolving Day 2...."); Console.WriteLine($"Solution to part 1: {Day2.Solve(1)}\n"); Console.WriteLine($"Solution to part 2: {Day2.Solve(2)}\n"); break; case 3: Console.WriteLine("\nSolving Day 3...."); Console.WriteLine($"Solution to part 1: {Day3.SolvePart1()}\n"); Console.WriteLine($"Solution to part 2: {Day3.SolvePart2()}\n"); break; case 4: Console.WriteLine("\nSolving Day 4...."); var day4 = new Day4(); Console.WriteLine($"Solution to part 1: {day4.Solve(1)}\n"); day4.RefreshInput(); Console.WriteLine($"Solution to part 2: {day4.Solve(2)}\n"); break; case 5: Console.WriteLine("\nSolving Day 5...."); var day5 = new Day5(); Console.WriteLine($"Solution to part 1: {day5.Solve()}\n"); day5.RefreshInput(); Console.WriteLine($"Solution to part 2: {day5.SolvePart2()}\n"); break; case 6: Console.WriteLine("\nSolving Day 6...."); var day6 = new Day6(); Console.WriteLine($"Solution to part 1: {day6.Solve()}\n"); day6.RefreshInput(); Console.WriteLine($"Solution to part 2: {day6.SolvePart2()}\n"); break; case 7: Console.WriteLine("\nSolving Day 7...."); var day7 = new Day7(); Console.WriteLine($"Solution to part 1: {day7.Solve()}\n"); day7.RefreshInput(); Console.WriteLine($"Solution to part 2: {day7.SolvePart2()}\n"); break; case 99: Console.WriteLine("\nDoing custom fun stuff...."); var quiz = new Quiz(); Console.WriteLine($"Number of occurrences of \"make it so\" in all of TNG: {quiz.FindInTng("make it so")}"); quiz = new Quiz(); Console.WriteLine($"Number of occurrences of \"earl grey\" in all of TNG: {quiz.FindInTng("earl grey")}"); quiz = new Quiz(); Console.WriteLine($"Number of occurrences of \"earl grey hot\" in all of TNG: {quiz.FindInTng("earl grey hot")}"); quiz = new Quiz(); Console.WriteLine($"Number of occurrences of \"tea earl grey hot\" in all of TNG: {quiz.FindInTng("tea earl grey hot")}"); quiz = new Quiz(); Console.WriteLine($"Number of occurrences of \"shut up\" in all of TNG: {quiz.FindInTng("shut up")}"); quiz = new Quiz(); Console.WriteLine($"Number of occurrences of \"shut up wesley\" in all of TNG: {quiz.FindInTng("shut up wesley")}"); break; default: break; } }
static void Main(string[] args) { Console.WriteLine("Day 1, answer 1"); int day1Answer = Day1.Answer(); Console.WriteLine(day1Answer == -1 ? "Unable to solve" : day1Answer.ToString()); Console.WriteLine("Day 1, answer 2"); int day1Answer2 = Day1.Answer2(); Console.WriteLine(day1Answer2 == -1 ? "Unable to solve" : day1Answer2.ToString()); Console.WriteLine("Day 2, answer 1"); int day2Answer = Day2.Answer(); Console.WriteLine(day2Answer == -1 ? "Unable to solve" : day2Answer.ToString()); Console.WriteLine("Day 2, answer 2"); int day2Answer2 = Day2.Answer2(); Console.WriteLine(day2Answer2 == -1 ? "Unable to solve" : day2Answer2.ToString()); Console.WriteLine("Day 3, answer 1"); int day3Answer = Day3.Answer(); Console.WriteLine(day3Answer == -1 ? "Unable to solve" : day3Answer.ToString()); Console.WriteLine("Day 3, answer 2"); int day3Answer2 = Day3.Answer2(); Console.WriteLine(day3Answer2 == -1 ? "Unable to solve" : day3Answer2.ToString()); Console.WriteLine("Day 4, answer 1"); int day4Answer1 = Day4.Answer(); Console.WriteLine(day4Answer1 == -1 ? "Unable to solve" : day4Answer1.ToString()); // this is wrong answer Console.WriteLine("Day 4, answer 2"); int day4Answer2 = Day4.Answer2(); Console.WriteLine(day4Answer2 == -1 ? "Unable to solve" : day4Answer2.ToString()); Console.WriteLine("Day 5, answer 1"); int day5Answer1 = Day5.Answer1(); Console.WriteLine(day5Answer1 == -1 ? "Unable to solve" : day5Answer1.ToString()); // Console.WriteLine("Day 5, answer 2"); // int day5Answer2 = Day5.Answer2(); //Console.WriteLine(day5Answer2 == -1 ? "Unable to solve" : day5Answer2.ToString()); Console.WriteLine("Day 6, answer 1"); int day6Answer1 = Day6.Answer1(); Console.WriteLine(day6Answer1 == -1 ? "Unable to solve" : day6Answer1.ToString()); Console.WriteLine("Day 6, answer 2"); int day6Answer2 = Day6.Answer2(); Console.WriteLine(day6Answer2 == -1 ? "Unable to solve" : day6Answer2.ToString()); Console.WriteLine("Press any key to end..."); Console.ReadKey(); }
public void returns_sum_of_numbers() { Assert.That(Day1.Calc("1122"), Is.EqualTo(3)); }
static void Main(string[] args) { dynamic input = "878938232157342756754254716586975125394865297349321236586574662994429894259828536842781199252169182743449435231194436368218599463391544461745472922916562414854275449983442828344463893618282425242643322822916857935242141636187859919626885791572268272442711988367762865741341467274718149255173686839265874184176985561996454253165784192929453678326937728571781212155346592432874244741816166328693958529938367575669663228335566435273484331452883175981955679335327231995452231118936393192583338222595982522833468533262224874637449624644318418748617949417939228988293391941457722641936417456243894182668197174255786445994567477582715692336249243254711653529871336129825735249667425238573952339922948214218872417858525199642194588448543565474847272984232637466664695217176358283788781843171636841215675851778984619377575696447366844854289534215286959727688419731976631323833892247438149829975856161755122857643731945913335556288817112993911694972667656914238999291831997163412548977649491227219477796124134958527843213824792685117696631512141241496451845758655276186597724748432996276498527911292531185292149948139724345841584782352214921634858734671118495424143437282979243347831258285851259579133433182387444656386679831584933397915132785411686688447731696776459621924821667112751789884987883991845818513249994767543526169463766975791464756526911587399764736557959464923353896921342944821833991457125256329564489631352268722457628514564128231487382111682976886838192412996932924373337524262135399256658638418515239876732866596731888779532573243713128238419234963195589987539467221517535272384899524386267268959484881379944796392255419838743164714275463459351741296586465213689853743856518583451849661592844879264196761867481258778393623584884535246239794178981387632311238115362178576899121425428114696158652976277392224226268242332589546757477683398264294929442592131949398261884548427951472128841328376819241955153423452531538413492577262348369581399925647624623868299468436859667152463974949436359589931136236247929554899679139746162554183855278713574244211854227829969443151478986413333429144796664423754818256172862812877688675514142265239992529776262844329188218189254491238956497568".ToCharArray(); Console.WriteLine(Day1.PuzzleOne(input)); Console.WriteLine(Day1.PuzzleTwo(input)); input = @"5806 6444 1281 38 267 1835 223 4912 5995 230 4395 2986 6048 4719 216 1201 74 127 226 84 174 280 94 159 198 305 124 106 205 99 177 294 1332 52 54 655 56 170 843 707 1273 1163 89 23 43 1300 1383 1229 5653 236 1944 3807 5356 246 222 1999 4872 206 5265 5397 5220 5538 286 917 3512 3132 2826 3664 2814 549 3408 3384 142 120 160 114 1395 2074 1816 2357 100 2000 112 103 2122 113 92 522 1650 929 1281 2286 2259 1068 1089 651 646 490 297 60 424 234 48 491 245 523 229 189 174 627 441 598 2321 555 2413 2378 157 27 194 2512 117 140 2287 277 2635 1374 1496 1698 101 1177 104 89 542 2033 1724 1197 474 1041 1803 770 87 1869 1183 553 1393 92 105 1395 1000 85 391 1360 1529 1367 1063 688 642 102 999 638 4627 223 188 5529 2406 4980 2384 2024 4610 279 249 2331 4660 4350 3264 242 769 779 502 75 1105 53 55 931 1056 1195 65 292 1234 1164 678 1032 2554 75 4406 484 2285 226 5666 245 4972 3739 5185 1543 230 236 3621 5387 826 4028 4274 163 5303 4610 145 5779 157 4994 5053 186 5060 3082 2186 4882 588 345 67 286 743 54 802 776 29 44 107 63 303 372 41 810 128 2088 3422 111 3312 740 3024 1946 920 131 112 477 3386 2392 1108 2741"; Console.WriteLine(Day2.PuzzleOne(input)); Console.WriteLine(Day2.PuzzleTwo(input)); input = @"bdwdjjo avricm cjbmj ran lmfsom ivsof mxonybc fndyzzi gmdp gdfyoi inrvhr kpuueel wdpga vkq bneh ylltsc vhryov lsd hmruxy ebnh pdln vdprrky fumay zbccai qymavw zwoove hqpd rcxyvy bcuo khhkkro mpt dxrebym qwum zqp lhmbma esmr qiyomu qjs giedut mzsubkn rcbugk voxk yrlp rqxfvz kspz vxg zskp srceh xdwao reshc shecr dcao isz wwse bbdgn ewsw qkze pwu lbnvl lviftmr zqiv iadanl fdhrldn dlaani lxy dhfndrl fkoukx raovmz pdysjsw hqps orsyqw rrwnzcz vrzoam jjljt wgt gzi icpwp qeefgbe msadakj jbbrma sbj dufuujx zex cfzx bvyu eswr hafcfy klw bgnhynv qrf aop rzlq atrzcpb hpl pajjw cdxep ean aptzcrb rzcbapt xogpf ucc nsukoz umtfbw xfvth ozusnk fopxg ubp iflb xot nqcdyu kpwix szo cyxv hpmp hwtrc zso nyuqdc aha mkzf cat tkjprc izxdggf obspan lmlbg bsyspf twox lfmfrd ooclx tcl clt dxvnyd nxwojj arutn eyqocj swzao tmh juvpezm teu eman rlmdmk xkbodv fvrcm zorgy wmwe hmo fdayx duciqf cgt duciqf imjnv vfmsha cyrusow xjswoq nclrmjy sjxowq ynjrcml rwbsay alsi bmzpvw ozq aduui nihwx glwdiz ixmkgfx vtjzc ntkh zekj qrbkjhn zekj lyfnbg afaig jqhli oie lhwyduh kqfnraz nfrzaqk mayfg iljqh inb zum zmu dnl zjxg vrdziq ypdnsvt uhbzmre mpdxm alkbmsq aopjmkl mqxenry ayvkrf zxvs qkfqva fimjr ccv cnug crdsv bqyve lhxdj ydu qbyve vihwjr vyodhc vmng dyttyf noagpji tdtyfy ewiest ogg kgscfj klmsv vmksl vmlks qlvh veo wruft wtm fbrlvjr evo wvwmny dhp bvrlrfj lvt vgzuyyw mxuro orxmu tivu tjdq ojjvju cdd kjexme gxbysxp yxrum hinrklv fxehytd qkt tqk umryx nim kywnux wab tzrft dsaz jgwuw dubarmi fle wjguvr umjp uzncwj mzz qokwh zrda xywufk tbxhhj eejqaoa hwoqk zer hwt hbjxth xyf hmh eregs qdx tdequa agrlrg mwwpba qjie yrjvhr txujk iyot fxwdcb zvwfv vfzwv wvkw ncwbr wdejrr ltcdza waix eza znmonya ldfghws ialwfvc dey ubsz uhbnh svgekg nonzyam bryz tfbqn xznfmw xiplgww wwxigpl jxzcgxl rzyb cqvl rrcoqxs staeuqr hzzow cwv tsvol dio coc ddavii uuojy txbn qvkkyh gbqnjtq ndpkqr srt bkpqfmm ytycev ypcv bpqmmfk uqkjmul dour zgq ztango yrrjhrg ufxnmuw ekxbcv vkxbec xbcevk jiq bar wczff qdu cwffz hhk wlvyg zjlconc osgsro dajzo hqih ehml hnio shccluw cpu ivaby tormn vkef abv vkef ivaby xgbdeso xiizs omqwy sbtnnt khago evviclw xyu dtvg wsyxfuc humewp cnzu bia vdyqrf wwb qveum hmh ouupgc owli pjpmfxa dvd lxgh ndy gwph oebfkqv vtlxdg efl ekj dyn mvan nmdkc ucyshia mavn ecst poo oybm pjwm bmyo wovgu xykziaq obmy eiirhqd xkvomx yxvv oxxpth elh vxvy lhe ycn okxglw gmaangx gnxaamg yduzrr nzwxtnd rcxcu xjjvno yat cin gaxnamg yss oicgs rrol zvnbna rrol abb edpnxuo peoudxn bab ceay ncpkfz gvwunb fckpzn caafx pkcfzn tsfl fnrt ymenkpq wodubcm niv nvi ziluu cuowbdm zocg pdakwt mlzxkex nuxqclo uouxcgl stgua otadr ideannq wizxunv iqsdpj mxddt ldst ucxogul rbrwyhk wqoz zqwo ikwgexl atpu iza smo yolp pcahlu muljxkq cbkljmz zlbcmkj zvbmgz eaiv ncv zplifm yplo ocutdhz zmnaap llgv llzpl loavju guzkfq saay rxyhng cwxzx lcv anrnzs etyzx tcm upxrtvd imyoiu rdpj fed dmm gonqa szteh szteh razdqh phyff upf knfqfaf knfqfaf fpsgl kakag mcju mixskop isrwat lcr nfyi lcr aaevr nfyi pqrbk gnful xfmr fkmnq fbnhd mxrf litniid xbae frxm zcenf yuh lzojtj rqsh hyu vbjgql yeshsuv lokt efqota wpwjfu ykyq rxc fxxh ycqfkk gndts vdf wnylmr kkuruxm azr xukrkum dohkwx dmdb bjiyrwf dvf fdv vdf gnokekr jsaq hcww iayqtu llv gdpxdrd hwlo nosjit wpm lcab fcgwr fxjp bys nnf xzllckh bys hvojw zcwtgwz wye ccyvjv grafa hbb ghk wkdpsf ufa uoqmysd yvacf kssbff iovrm mvrio cfbpb avh zzje gqd qmsen wkvrfz vhtsa zrwfkv gul zkvwrf hrbi svaogb aogsvb bgrk hibr jbtkr ljl ryc mrewrge yky fcqyymt emk qcmyytf mcfvusb luy qany cbsvumf oknt mcozuc ccmuoz uoccmz uziil xobutwf acnof iqgwl diso sekq fxbtsuv ddnnqg rnemlt dngnqd hhgjfus stxvubf lajcp qgiw fyz blrlcd pviwv buh wnkk wolqfk nvpapfc rwcqxfz xobno yzjfz irpj wolqfk wbnwjt vmabj noiljne hhqf holxkbk swwzx ylgj lnmxy lqodhk abjvm bmsrf bpnp yrz pjepxxs jlmhuy vihlx zacm inuazhc xsxjepp tryl kryh eonvaad ucevssk umkxg lqej nswopjj svkeucs bmh stosxxz cfdwd dmfdrvm ibuhsz nwtgmb pjt dmfdrvm cqdcm fzjjz afa ibuhsz erwp abn jwx ynmkkj rhgg abn epd atqhs rst rhgg jtnp cegdsoy gfuvfbg gdmn ahlsc jgrp diu jrgp onjnml nojmnl vxockc lakqyuw khq dcpiwt ykwlqua hkq plklx ujbckec hjcvur jnp pvyf usuvoo jkih ylafyy yhio jureyj uazisdf cnwlfnf ewodatr woaddkd wbla qmn atdrowe bnyepaa ntqh xppe ydtsw ppex yewjwsp jxylmtk ijese ewry ijese kbja nfml zeuwcsh juimz qbvmf nca zsfreo uurgaiz twe fbqmv ncwi etdcsk atowfp jeotslx kgdpzp wxlcww pdd dcn ddp macllv ldl kyluine lbt hbxbr wxcaspp ezwvc qxkeu ivg gxv zsf ucr uff yrz tdlwbny bqlrlz tbynwdl lwtbdny tnekq pdaievs ttwpfh xfm fcaa zqqhl zbf fbz uqrv bfz ffwavhk foccg vcw ebqdd cwv eddbq nrmq hpiusz sizphu xzq sgyehk wgagkv hsygek vagkxa iou frqdnnr ipcg uxvh vvh eskf katgpiq aqktigp gzvseyi xkwgd kzfxk pgdy fmtvq ngf rshx zti pamviob ely knz hwo rteohu qzwoe rotuhe wzb bsqgg tid dti gtats dit sjtux djwxv dljwjq xwvjd xnqfvx veqdrtl uxtsj nnkjn wnhilaf unirrp fruuqjk gtote gooklg bzwhim zfnccmm ezipnf cxwdxa wfu fdca zcyxb byzxc cxbyz pgcqco ivlxz wrjh zfdinsf ihw xwosiah hdg xpiabno bilyy azdeczg javuwa rinlv dcpt qhencba mmb njxw gadc qwcpua qzyzt cxjsgh kumh byiimas qhsgf qytzz rqqruwp ismyiba xydcxz rwkscqa xbzefi hltca ibzxfe fkx xizbfe wvaynts oyuce vzk ouxvj gfh efgbv ubc nyb bxnbhd mtwboe whksy ovmrt ljrebp tacn bpjler utphw wmfw rcnha drdnic eyodes rcnidd yseeod umxmsf kfroz ukhjin awpnnnu ooyyohh tuv rafano jze bakz lfzpjyg gfkqcgn kzh zwpvk gqfngck jpaony ojpnya hmro xaaz tovary aaxz iel pbg swvbgc bbhjp yvrcddd rhj clfu eao afrkegn qvvb yvcx nxjmdo rcvtx conbjy jeqtri wvujt jeqtri rkhllgw tsdt zowreo qxr qbpragn kuzmplw wvujt jrpxyp hchljy rkowqb eeaf ltllebb gtksrwx iazx vnsfmc zzrxw hlcjyh piehb cjdzt eqn kuje rls oaewoz lrqwt lcrrq hdjowxv uknhlv hluknv pokxg txiqxfr fyyp pyyf xfxtrqi tvm rtvby cfx trx nwrf kqrxtat alwot wdaadr stexpow ardawd uejqxc wwgwjel wwgwjel mtjt wwgwjel mczx uua lgceb dqru vkcea tcet ruz jkt yroojr qdrtdu wze ovwz fdmqnr xxsyfd kchytwl hctlkwy gyd eif irnrce iamhxgh bmis uxye azrwdi sznv yuowb vdlqqxu dxdjyj hngqwzs yhwku qhsctfe rhbc rchb tqhcfse fxyxnzs qtxevin rvtxtc iqnxtve zgbpk mwzxx bgpkz wkpkn rjiym iub lcyw agbtlb bzhx osv rbtf emmyu uoflio tinih skpqaj rbor gezbhhv ine mij qlqte uuj ycns owmwc uhxv pyho ftjh jzsg blqn bszyo bob trbycy mkru mwgz bbqsmpp fgzs bihhg bbn pjxxexs qrqmt htsxfwo qltqp vqqaxi lpr wcvy sxjqq ltd rftdgv pdnog ymu qhcos shuy icdhucu lrikh rwslv yxbgibl rcomhn wakirz civdmee owlzocl vedecim rogmjnn pix pohcmk dsjm yworm vzdpxp lvt inufv yofqt omm qfoty qrlseqy amkt kjcvg vgkjc huhq quhh levzsws sjuun ofgqr cjhp nfxbbft rnt wtbd tbzab tjftkx xpfcv hvftvhw lpypbjg batrn fhwhtvv uthl arbtn brb sthv ogr uyuxdco bpjgir edztxv sxtgu jzfmx ihnauz zwegqkr kvkw mhxthf pervvn gshy jig ezjteq ckkcpy gww tiljyki rpe prcojy tjkylii moxu pjsdqc lgqydfd lohck emrtejw axwmo wuuv rfi qzyncmw gjijdfb bljfd xrs ywjab gynzi relf kziy xmsby izyk ocwoho kqnyh bwayj bhjlz uonz jhmzuq eiajoos zjnbj tomj bmyv hjlbz fgw jjbnz kszz xzw xzw prtznyb ghzk vxhwt thxwv slwpayp qxegmi dawdwo kgzh ibpcvuf wnuwxu sbf jsj bfjynl cdp jbylnf epaxr vfhf hvff azepadz pwf sbo pgfzya hslyo rqqj rmklw hwtta yyolko pwbvxvg xdwl yfje hftep kzzsr kho jeyf yvslxpw kfyv xmk juyjxy eqno mdwklum reg dgn cirh wmxfyj bnxlgo dlobk oyv gshqyot jgcqe dsf gyohqst gqgeojo egoogjq dmqpyp sypianq yss lmhu ulmh itilh ndkda lhiit qbxxl bxxql ikald nfap qixwbqq jtqhqty ljysnl nwoj toa bmmyj pal ahktew sxody nkvsf pbxyt baws wgwfwej bevgzm jus hcvajfy kzrb jwgwewf jzsb szbj ujngwf nfuuf lfiuxdu uufnf orsy vgo hto isstyul gau wsmxoqw uxw itwf epaw hec wape hemol rpwyosc xzxmrll eetz zui kagca mjncux muv rygdeis rygdeis qgkqjvf iprzibd fkvqqgj llcrl vbh vlf lllrc zwrunt dslsa wvoex eqbwj tjem gbx ayn xcan fnacl xggxon gnwjlh yzosv hcxjiz yvon gcgd bixpny ecln sda eymt bjiwk rlcad lrdca adoqfzs rgty mds pwb kmwj wkai pmryffq rrdmodc wgyx taz yxwg nkap auynzwc vzg uapdv qkrh ldmuysp oyu kpn ejbl mfifa bzs hwyn brlw qpzqx uyilao ysdumpl czoxoj pwnultl wezolbw lyk aonesgb nqy nhb nle yycp lgtbo ojf dytwyh ufa rwr eph obg peh pejret prjtee ovgz vdqf vdqf ycjrg ovzl lelbe vdqf gvagdqm gvdgqam dmb zaxe nepzwn emwh bkkbgec qwdgk mhvfsrf wmdfpp ekzuua mbqw lgkyazt ckyhvnq uladwo owt qwiwd pbo tkjoqda zapo dygqopv zzdlwfn qty dhb iinncba ytq kvh idgoevt chx waq ulffsvk vplsz ulffsvk uxsh cpwgxd ikgcacx nrirke uowcjvn gknmxr grkxnm fco dilyyj grmxkn saqxkh uhue nvu fef xsuxq ekyyoc bcaavd qltwqa vrmpv vhra nof yprauc vkreojm eaq igiy mec wvheiyg uthy gpvcs nhnjrne mqaejr tfnsly zfbhn entcc nystfl cpq zxv jzk dwsjgrd gqqxhp xqxu naunwc yeh qzpkz awcnnu aoosa icadax vpmqmg qmvpgm tqs mvpqmg inehzu zwxeoy jxia fcyzxc hwikd bzwnp kamsen ajpn kdls bzh xqcb bzwnp cmjnfa wmgx hbuhc qgvhxy smzkxh zzebox hbcuh net wyrdppc yvgxqh oeum oemu iyags xaipdi euom tqljgoq ghtdhw xhnni lux qltojqg lki zxztda pcqjif acpzvwy ydijaq kbyjxpu onyd hsfgz geqvbg rwoih xog dtbzyr ryzbdt tdbyzr vcdxf zosw pardxfz bmb mscmain lwfc jvq hbszcqh fxomsmm ahnugx zutsemg pqzil ddv nsstz gmeuzst bedvy xkzzjpw xlqbd xxf ltnnu yeb hbml agj meovtjr qrul kexerkw xxf tqrpd hhcx bmdv nlmr pnu pajdtc rpatqi yekedx oeiuew epsshog ttbfpv plairk toh jagfsg njnqpa tmwh vwqp irtxv vdky uwc tkkkztp vdky vdky qlcw lza rzie yundymy pwgx wtwtbg kpiw mewnb liveysj uvsbn jgfvyny hacg pzra arpz uowswu puzsfu hoe heo vrq naup hqv vrl uko qgpikho lligvxa wdld qgpikho whvby yomxwj dieffc jkprinh dsaqy yfrnba woyq yexeb mjn cbszn xeswvvo wowtgu rciyg rlas bra quyfec ihe thuu asxhscu bsbdpbi ogxosu vydsaet tvnkjq piedkzj foeiqz zqivt iatsju tjnqvk drauaf vqitz invoz cppn jqzw zmxr qksuas iifmjg xtkgf cppn cppn jpsd nkifpsq cxdx bokxhm ebww kghagrp bofhrl grc cheuzyj ibgrlvm hrcx jjuoh ipmt hcoqkh fzt rgravb cimauj jxjq blct qhc vjxw pqpg qzp jycxz xcv czxjy vxc liljaur cgmg neldxb xfummcq yfhiukd dnqhl iolxn cmewhb hpvoihj fkwokod txy uuktw vmqqb dpldzh yxmcay cyaxmy xycaym wekr ccnaf wuxc ecadb vbgpt ccntf sezo skjdkbf fnctc hqdtwho kdhyman bjtcjvr bwllva ncyffyr xprn jrrvmj pdw yvexm ewbflbe eapml rvrmjj xmevy rxyzhf wjcbpy qdgtcp cfjh muww fhg sgfdleo nelpte yucqa aavev rci vqypsqt xmg rzii gramh wwprtc ampdhw dajr ovrm mdyhpbl mdylbph aykz cbmo fxs nuugu guunu upt ljjuhjw nituh utp kxqc rhabal rhabal rhabal vah lfrs nrq qway ftzp rtjcks mbygdtd hsiqbh wypqb rtjcks cllp hsiqbh ywa anhcf nvd puqkwg molrwck wsctx xvd molrwck wox jzq jfen wcvus cswvu oxw irg lmu tpj viahm jesic qenad neqad smlgi ydwzq ppdemvs ucyuf qtunm eoqx jlgv sucpl nrdwbl ltvetok npbw ozzw hafyay sjmui sjmui jkqlq pyn pbuopx nxgaiu ybyl meo kgh saqjaz xhbqr otelcyp vkwc iqrl ldjlwvl ajhrl dnhutr gkknyqs mcvluet fgyu ogiz cxo aiunl orb psd cyq xpoyqny yqc kozqh vonfd uhozwz pds hcpw tvaxder tulwmw qiw avddbmh irog vynjzcc refx efxr emnvk myjx npqk whm egw kpy igrrohg ukglx ldnuqw caqg ynx fckhnsh dafv bkdoqg zcqvbco xgikoac cvbqczo rtzhpwk ukuyp bayhzp upkuy ahbpyz oarcuv pnlkxvw fqdkj hwzsz nauwl lpufibz vzfbgc unkluxy rwh xuknuyl vxhsaj ppdxw qrswqtu ulwv uqtqwsr ppxwd cww cww cww scu wiiikwa bfpewt zbgxfkl iqpk tpbwfe aazdcxj ipqk icggn fwn fjr net ovxuwpz yvzmzd yvzmzd xgar czuhp vuhisaq fgrqxy evvrtf mnmar lsk hld mxuedug itswju vmmejqx snzslqj toe bbmugph mgubhpb mowj nrjnzu qbz ouhye hsldmp lcf hyhlrb ewvle zko cke mupaq quapm eck owu zdt lales tzd apjjo fhpx bmuktbw dvehpz libvl zxypk azazc vtsom ohdzycb kiowxnc scxygrf ckxnwio ycxsrgf vcjj fqz lfawfx mps zhv qykch vhz psu zud spu fnpvkx scfvum fuktgk tua ieosetl wwmjtt exnsw wwmttj plvd pfb kku pdbom wkfw snukd wkfw gyaojdf bjw htagy cdsp beh gatqxcu ibrooxr ssww orrioxb eenkqz jlv affah mtbemf tylh aafhf zqfajd uwzrw csouuip qzadjf gsnlrw tcel hha tfbzrp ild aenqa iirfxef kdux yvj vbzgj ibx pfll rgkp nancij llpf xib gbkfy uvw kkbavj pznsnk okigtxl ogitxkl eobbs xhaz wroabn ltogxki bivdf lotvmoh vrb kpaeeue tdab qhukcb qmy kuqf kesu egs hbsfeu esg twxko uib ocraimu qilp ijmx eco nhevqp juxf ksejr bcqqau uhpt pyx jmpglf juokd dxszjw cml vcjge pfg gxwrt btmimse dkpbha idmz mtignka ngakmti dpjhm jyalra hukf imocr lkgt rqywn quhe fukh nbau xyc bdh yni xaawxm cyx xwaaxm akx gyodqe htbifc bywdxe bfrp rvb rndl onal jghiwb nuta aint qlciwcx fpic yrqce land soxhci qzc zoebsq hcdohcc fzhcl iyxb dqinum hchdcoc zok ghgp zok lmk ozfz zofz dkdekzb sqc gfti zuqvg cexmtyl qwuqnj stepb erduqhy cuoizcs qudyreh kqvfdd guzqv jrugz jzugr lmqu jgihgo hjfbz duxkn unxkd ckiys dbqmi ckiys ckiys iylp uvvdp pluifaa djo esxec rwvel djxppqf jymwt ilm aiz upn aiz wrfefwi rwvel nitgjr pokxuy puhdwg qtxpb veylp zqvzkbd lrvpcgu zuy rnigjt ibci jboyzq ogcldr hlon ywav jqqtz qjzqt vyaw c*k aqdw jxn hqknh azbylg jya qpxtmsj hqrtsgg qjtpxsm pofcs sxw dlvru dlvur swx yphvvb qqyyfsp sjkbff dqyerxe jxzes oof pwbya txk bbwsj ywgimd kmdpc bawpy lbnt bkbazff ldmaq tyfl acqurpy ndnrp asw ctiv mnxzyc weeuwb gsn bzk irbyhxl cgqomj izy zbk yrxcrbt bcrryxt pofe wwzl vuaqez kbtuyai vuaqez dxqud uvo gmhtg dxqud tpzs gqdxpxo zzpgta uurjx xpqxodg cil lsv vznqw vro zqzvjhm jhgauzw uxnwk lci zpgpu frjvyzo tsv zfvcuim gwn gnw dxfppok btb goof iwadca aac tbb jha uvzi qah ned ipmure kyta ffhrwe njz paq kaag xmlui rkmw vrblwyy gpax hxsf zpbza gypuwf jbib ypcjwd vrlybyw yfjljn uxpvg huik jsnah nkhsg yfjljn lqzsz hagjlqx agnax jqalxgh rvjgtc mjrmph azznzcq gxajlqh ipki bhoabp rmiyl dmjyxl zzsmap aju tyjrr rigrf ciq qic avmwu jtr wpq vuf cosgytm toycgms ufv qzpcbrs epzgxr lydrsj ezxrpg expzgr ecm prj kmak makk jpr ccwyq txy okj matxa socoa zrjphq gigayv ywkfmru yrwukmf fxjjrha gqkxx zhjy tisutx kufrywm izjfj igg lfhgsro gsroflh wrpo lofhgsr kgkgj wkhnab ubrjaoa ubrjaoa ubrjaoa ggdgh hztutpn epnqmz ffcroq mnqpez niibpn kdloak xjui ozttj lyzsc pzgq inpnib kruz sjqp mmd hhdxjgc mauouma asevvo upjwqi hxcgjhd etqzagp zylf qime cho oraid svytv gqrjufv mker cho vnkyiin tjms dotjul qyv hnh cibtg gdpauyx wzp fabtira ejxoeor cqyethv ndjrq hnxn joq otng lrr csytrub txhgepd fwdaanm nawdamf pxine qqrn pronw exnip qwkimt rvy kuxzhi jln urzxtw rzu ebsuylm tscru qwlhfgq nnu nuchvz vuht cqgu camlr umkltcf stx izp rtdwxff wkfvs jhje cxix lefcrsu nebv idfzhic xqri xkft utzxb znb ietupd uqgbhje aobip oawjwm hetyan uqtqv hpwzyri kwxyu jvzvbt xuyvp aegdkb srbw bzabpf lyfriez cruyfu nhi nih aeb ihn hcf zypt djcm pkjx pvhh rhvxcfk exydvk ids hybme hnk yfchvs mjbo meocn rpboxr rxoprb hdzje zhedj ziildbo apzvatr vsv isndq ebxyy ntm tdttg wkvdh qnids vkdhw xxolip ywu uyw ipcjz pjzci xjn kvgk vsocprw euzo njlpv ndrlhi drlnhi ivmjkb fjrtxta skvgmrd gbyvj dkck gevpfvb lhadhx rgjcdn yraxh bdk oen vqryd bkr vgkp hncttxb wgxh gdyjo bbdfzvc xhgw rznzgda yxrrlo gxhw ifjlb fpecyic svhjp ilmj oxgr svhaf vbqky lhccj xtmm xzjyykn oqmdq qywir bswly euxxziv totzer vsxfx leo djho uoeaz edaig fbu lumbi ooqtwq pvo kid vpo jxin bod btqc fbyuz jhabi mronu htqqyz umjcbv sgnbp wyn cetmt pcjf tnrkcyl dduuhxh rylkctn pwj rtynkcl mzzfomr rxx ldqffi ulappk nltawbn tplhb kyb cqyi vzkw gviooah vxh xeae ohvcad oaiwcj dkx sdofdjt hcifv dqws sia mlwm vfich kavh myzue roops mzuye uxs nlbmjp nlbmjp tlaxa tlaxa ynnisp twx xtw jgkc yinpns kumorsm wav xhx bpvz clqc ffmadzl ndny ymslo lobv ljzabj tqhves mezh pwn wue dwfqq lynvtt boeknvi xqbd pkud tzlanis lgq qiikzl oihnsr pivtjmu qhic yvmeebg rxu qgl yuxnqse dvu faxqez ldk mlwja vmdqr yzlxiua amlubt ejmzfx nonm zhkxbn gaqbnqq ttc ctt kneknx smtnaft abljip tct uybhbiw zwojzlm cfxoopp abulenj znz zzn opllzmm yufk witwxzp qvkybwi rdbxb qiuizmo fqgne jgot jxz dqhapn vzinf ehaley amnk laheye invfz pedakl ivld agzyhr wmzba tzzzg bazwm wjwgux thrnxkn cmyhae nwfs nfsw kmh pxkaffq vdf szupev tyunp qiiu deevxmy wozvtt nelnr kgdexy gparqj hajavz biizn pwspk skpwp ontbjee pkspw cfbj ihsmh djxtak wkzllao oyr djxtak prc uhvihqq jrgf hdfek pdrfpt tghz gthz awae wcygi wujti svq fhedk gnfhsj odqlt netmsul rviio nkzw nkzw xyvc clxw cyxv lxcw duegck pkviu npwsp zdx wpvn dmxgnv ixv fybs xteru vih kgk hads boaddu daiwo hozoufv nef vtcplc isiw tzqoo dqlgvno jzlay sywx ecej addt ecej addt mnfcu ymgmby zegudpx ipsjai ger wcwjw brzebb eqekxlx itra xekelxq exqkexl rciu ojaa ircu nxjga puvmwou remgu sltth pprimb slnxopq avtir hvpv ppww fhfap wisn kzs jcuuuuf xbppc ydpbq zhjh oym iljzvk vsb ueye shtps uccehi ccheiu dqm yeeu gwywf lcpv qza qza gzuovj jfzffyh oybfxqv aawi ynsvdco azdoz cqr tnyquq xlyvbx eca kcalpes zumgzhy rou kguqa vubw bwgd qprxcg etnbev nqmi fyd tuoz uwclqn cgl lrpkf irz dizv nxze clg jghx jbpt kwuanos eorjr tcahp kwuanos cyrpfji zxayggd kwuanos jkqt qqvbork lizk vtu ovje vhg ovje vtu zcy hrhtr puawfgv bliz exp wot svxv epx jiqgxwj yips hjsatc jgsrno msfp vxvbt bba bqmw xjgpgog vpvypp ggwp wggp gndp hedpse afji hcqgof hxueubt hiynoa qqzaj ohb qway akq nfnes sdrlza nfnes weq udxpdpx gctuv llhxuow rqtetm hdbnpte oebapv civy oeobu ftgivd pykj pbgbvn jgmr xrz dfn gosjobw ndf gnf dtbsnc fwcmml tscdnb fgn qgadusl eifpk vmnv yuxrup qcphi tanc tnca kjrv cphqi hclggs sghglc fgplp odn pfglp emkrulf whwtmbs qnuyg wcxtr ani ain sha hsa zxbkf bzxokat qezo ljqxi xqcwfmd dxo waiq smpbu dbyka uibxjrg nze wiqa rfpts ddjsjv jqqjez bpusm lpcxf vsbj owjwc tuqj vkrgrh jsjdepv oil lxrjox frsxsi clr vzunp prwk nnd rfs vpuzn pqpqv lvsk sqxf nhobsm hakbn ywj xxu uxx szqnmi lnwtmx akq nmlw fupwsth jduvhva nac wwlxqck hpbce vxxqa fyp xvxqa kxwclqw yvlmv bfwi pzxjbj nvwv mdooiez vvftp enjrsck iypu uhru fpx omtd llxgp qwf pwaj cuhb scloot hbcu jgp vjw ooclst sisd akawvzd wvdzkaa gyoij ikt eeeosb jiwiup tche vxj sbctqv jvx gosur usgor ibo yqxo qqgd zspl cidd welisl fxblxqk qxbklfx fbdoqcz glhq iylodvz zvds ghlq cnsa hrxst mrnkqtj bptq jmi cpbcofs kveyeur uzmga modphm rtx kntqjrm dvyup usfaq rtghoec bvcos fqsua zohwwg onf vncybi dlaxni oqyqqkn okfwa qyyx ebnv llql nphq etdt ytgivlo jwgwz kiob ann vqnqvpx wth lpwid bjvzw xpwqxcj azg ioeyzzp onwf smy epzomx xep yid zctvrfj astdj cfg fgc eriuxt rljqgin wzobzrh cuwtx vcsbx tmg tuysq vxipgho ewp rsrnsj wgeyin lrji ddgt utol xxwut fjiwopa upu ftvqbk tfkvbq fdwga rmu puu hbiasjw cfl lmqkb lfc wbtlfi uqsjs ejgmphi tbliwf nzcela gzb zop unwmiu acull mkwh hvruknw rfk mmhaz iqmenq fifino iczua bjut tlgf zicau jtbu mtka ipd mdifj kps irqkysw xfsjl tedx yckkbx iktxb sqxn pbfvubv uudzppz mdrn cihat wcext kufs awwtjok pfjg wdevt tyo zzbp pqlqq wdevt yhatqkv ntuhw tdfd buxazh xbcsv bas gkv rbzi tddf jbj bsa malip hiiy qezz yhii wlfojre zqnfll bssveq lprwbep bhqml tztbt npnxotu yupdytb jptqo klfydfe fpucmfq svxcqr unopxnt gdpz gwj iytiohu efk ctjzf asade abhotq brmhu tbtdur zzksbh kxft klzslf tjdzciy lzslkf ejei ezmemvg xlt zte tbwhz dgnfpao zotck wus uaz gbwbb dgednf vypmbs eiytot empfmny uopmui uehue wdvzt adpfcif mutl ifaztka vydi xumtz orstno dleero olxiq gxnlfm nfmxlg wloeavr olhrwg hrjd yicj ymyeex qav gxyjgfq hevj rqcne zycgb qgqtn rqcne ptfvu yyyu zlm hevj zrkhuh sttnkt hkuzhr vqtu ppsfm kcao qjq dgadglx cxaawjn pbucfu fed qgioarc dfe ricoaqg vmawf oktunea zraoir gkt zraoir jcvkqoq mqgml ecawug ugwace szwul iwbmooj owmiojb auggaw cypcuw npci vuyxijd pofswjx vdkrgx xylk rom ksj qmwx jgsrdj ikva xzxw avik zzhcqu rbg pywjdn wyndpj zchuqz wzd wqycftu yldezp zovuy oydia hovewe kfid qkkk thak qhbf rvzlzvu uuxh pbj hkat gow oeqcw knqqzha sua itv hfpg bdqye bznlrk hfpg bdqye kvir kaai ggtz jqn ulggl guitamm tkpckso fupacz otxtqpd jxnqc ueesb ndyik vjftz jgqqv nrcf krh dqpmsw fybzynl zhjbvkw exefc rhs neq ldprb bhhvxm pjwirun ymavl qwxr yavml wagwc ekokrpq zewppw iumcgin cxdvwx wwdukav kuawvwd kowv dkwvuwa eazot bil tzu vdwwbm fvauwrq esq tixokph yspf ztoxfut lgzush pwv swh pwv auqhuu tixokph pdbeyxi poio mugfkb brwbbx aao uszw fokjeb uswz sbs ryjr ptispi tvnhu htunv vthnu czjmg hbdjhvi jrkoy fpgwc syafy aar kvnq eaecsb wqzpx twtp dvl uvyje qtlzj dsvyr qpjnj eyoigx bhgpccy gwn dtuf mxit xunctu vbyks wmqc jriuupl ybvks uncutx nsoxwrb ykt prc yye mgf uhc irowpc dsdv iwaxod ftavlj dxzp tcch tcch mefz rxe xwrrgl xwrrgl duu rxe xbbgoe ucsz akswcd ojrmqq cox hgfh lxwu ltnnf cenikcp opjhdp svwezr svwezr opjhdp qojlkl ircxqnt utfmdg fcvr vehkcvt ufmzcpv xwlh ddavv xel bwlz fii rzkayeh iursm zhily hdnq fqydfvt uwoy hptpiqu tdqy bgr xdr ymruz umzry hbltwya jhwhzk flh tahylbw bdbaimb qscbp ntkuf uxpato owsqyao vaog oenomkc usrmnc epua vzkppls qxqczbk qyguz alawj xgjawtw wxtjgwa snfcdmz fjfgos rmpd mgs vbk dlls jkljao eoovdfb ucdvaoq qmjmqku ney porr nmcrqz zcoxpk dlnzksd ymh zyg spxss ruyk bychq gsgv eusiuid mnrqcz jbzadnx lzl sdamer okoico frqisrm lxet agriw xceoqr qai vahc jjzifsn exg igjpn wfy ukn aag quro wklsq cjq bgtjrdz gmub wyhh fzlwnm mygfn vkzwvw zvhsex gfki ijvzgai ebmeq wssfmbq uguh sfuutm nwkgmex dxael liakdxs rnf sky yowpxc bjzkyjh fced nji esowk qxsubsk qgtts nkdgo bbjfq fgnxnhd gfjchl jetdb xubsgj eiju ldlm oxsx znft bbqfj xovcnob pxfe pmstes yzkdm iqlvha nmcziix fexp ivqalh rxecqps xpyew xudfud wwqe qhfjlcu epv fnrbgyv ihli qngtx yjlfg ozqbzn esp timl gcohx vqzic gzm shwlkkv icqzv urchuc xpqq gaqzwo cci dowahsr gaqzwo jjsagdl umbpxre kyre zvaryft tmw pxpnjy aqovcz nunq nnuq xjrvvh autjmit jiatumt elg lps lge zjjot hwz tmqrup xaxxmo zlbzp uftd fukdad kvpymsm iokwzal ywti zbdmzbu lprywe wbgbwza ypogbga kzliwao wstqi eqm keaeaj gbabwwz lwfpk mhufe eddzgd ljxyqy vhzkct uemhf lwqil fzugdo faq feppo usl llwqi nje hthr ropq qvcepu bexszfj avmzjvv zajmvvv fhcd xnc cnx qnuaux kvksn dphbyz nsx wrcc ccrw nzpa pzzunfv ygzjy gxrrtcj hrt trh pwxpg yifgjmo fnupzzv wbzx aepti rbojui ypvhe ubojri tcema aan dntkw qjx bfvmyos tcm hvoqytn qpwq exu jvsiwj gsw avr vbemldy xsbzpf xbzyvx xax sxh vpxt gccy xxa zhgbwoa hwwxoky fhvdxfc pvtx pnsa ovtjolz tyutl eyjjzt jvtoolz owbypvr tytlu ewtzgec cyg dwwk eihsp aeuk bbnay aluwyz hdmv uaek mwt ihpse wjhnkeg fhzx vjetz vjub tejvz ewwyb jidhu pyvyenn igtnyd tiwr akwkkbi myz xxjwb jjrdeg jbkuw kwir rkiw ubwkj bltffuw lftwufb hhsh wfbtulf nrxaa rlszi toijxnz czlci bqrm pga zgblgcw pgwhhn lcgzwbg bcgzlgw yqb mhjj vjoa gnjlc kclcr ito ofksy giavy fpqeioj bkiqmif izidbui sttxxi bswhkxp sduuw mjgnvw mjgwnv ojzyuv gvj qxn kkhc whd fgwk auzugg augzgu kqfov wfgk spdxbnu xpfofsb bpfsoxf ahjywql spbxoff bwqxhlm wbqlxmh kqgpl fyzgf guhkvgx ovk qhmp gnrmu wvd wedj vvwf hcnc vvwsngj qedzoxm hcnc qedzoxm kjthdi cbwqep qtvu gio iqklmro noqablo bab jiqc rwebyg rqkloim wzmgs uunl amqs iwj snxj szobqt zcgvwv wiyqknu uto jteikwd cew gqsks hmvjtcy sach zpgl qnkoex amhufmr figns upv xezrl rjleak nwrna pzkvrdz dtonazj gtr gfxucuf lstjl lsjtl rgkope kzpdzrv lyptn zfxjys ttk ddxgm lumlgki jhv doft kok swy ckds swy ddxgm lbfbdv qfs rcufzgz iaiqw qfs qfs nvkbo sgv mquwb ritpye nbkov poex hraorm qrrr qdt qefl irxannd fiud ehyb ggx plqg pvvn uuptop tcvbm abuf bcfnmw qwya ukblz epmbfr vmlon yqwa hlo mmv vmm mvm svzpxun yugbbe sbbpxs dmy xspbbs zhpovyf fyovhzp cpbt pke zgk gft zybs zrgcoo ypu bue htgo xnesq srsx pkzaoh cfqzugh lntd nvxetbv clykjpd svmibpx evxtvnb yldkpjc jsqq tzwak hephg eqwczd ioisa yim tmdifn mceip kuwqz wzkqu zwchmj lfec uexne iztp llityt kvamkpc pvbryqh ion cwizjde gln kcpvmak pzzlw gnl ydeqf bfaab sydqhbp smsxdjr pynrs cqymt onb eiab bno nob mqslq scnelxv hyllrf scnelxv mqslq wmnbk pttu kubby lgop bbyuk gsk skg ikktlbb inbyvz xznvl zwtdj vbxdyd clhw hgy zudelp ickc drfjgn iyws xhc zzv wik iorhat qkb kjb lykdz vrce yjsjwj gyw xzgbi efus uuy hwcy ujdun bjjuvd jbdvju onnk xeyy mmp onkn qyzl jwfm ptjwrbl hhuv uolz adyweh qpj wxyogp igvnojq jmfw pqs fsnirby"; Console.WriteLine(Day4.PuzzleOne(input)); Console.WriteLine(Day4.PuzzleTwo(input)); Console.ReadKey(); }
public static void Solve(int day, int problemPart) { var puzzleInput = _loadFileInput(day); var solution = 0; switch (day) { case 1: solution = Day1.Solve(puzzleInput, problemPart); break; case 2: solution = Day2.Solve(puzzleInput, problemPart); break; case 3: solution = Day3.Solve(puzzleInput); break; case 4: solution = Day4.Solve(puzzleInput); break; case 5: solution = Day5.Solve(puzzleInput); break; case 6: solution = Day6.Solve(puzzleInput); break; case 7: solution = Day7.Solve(puzzleInput); break; case 8: solution = Day8.Solve(puzzleInput); break; case 9: throw new NotImplementedException(); break; case 10: throw new NotImplementedException(); break; case 11: throw new NotImplementedException(); break; case 12: throw new NotImplementedException(); break; case 13: throw new NotImplementedException(); break; case 14: throw new NotImplementedException(); break; case 15: throw new NotImplementedException(); break; case 16: throw new NotImplementedException(); break; case 17: throw new NotImplementedException(); break; case 18: throw new NotImplementedException(); break; case 19: throw new NotImplementedException(); break; case 20: throw new NotImplementedException(); break; case 21: throw new NotImplementedException(); break; case 22: throw new NotImplementedException(); break; case 23: throw new NotImplementedException(); break; case 24: throw new NotImplementedException(); break; case 25: throw new NotImplementedException(); break; default: Console.WriteLine("ERROR: Inavlid day"); break; } Console.WriteLine($"Puzzle Solution: {solution}"); }
static void Main(string[] args) { Console.WriteLine(); Console.WriteLine("Welcome to Advent of Code 2017! Please pass in which Day you would like to evaluate as a command line argument!"); Console.WriteLine(); int dayChallenge = Int32.Parse(args[0]); if (dayChallenge < 1 || dayChallenge > 25) { Console.WriteLine("Please pass in a valid day challenge between 1 and 25 :("); Console.WriteLine(); return; } switch (dayChallenge) { case 1: Day1.TestDay1("181445682966897848665963472661939865313976877194312684993521259486517527961396717561854825453963181134379574918373213732184697746668399631642622373684425326112585283946462323363991753895647177797691214784149215198715986947573668987188746878678399624533792551651335979847131975965677957755571358934665327487287312467771187981424785514785421781781976477326712674311994735947987383516699897916595433228294198759715959469578766739518475118771755787196238772345762941477359483456641194685333528329581113788599843621326313592354167846466415943566183192946217689936174884493199368681514958669615226362538622898367728662941275658917124167353496334664239539753835439929664552886538885727235662548783529353611441231681613535447417941911479391558481443933134283852879511395429489152435996669232681215627723723565872291296878528334773391626672491878762288953597499218397146685679387438634857358552943964839321464529237533868734473777756775687759355878519113426969197211824325893376812556798483325994128743242544899625215765851923959798197562831313891371735973761384464685316273343541852758525318144681364492173465174512856618292785483181956548813344752352933634979165667651165776587656468598791994573513652324764687515345959621493346623821965554755615219855842969932269414839446887613738174567989512857785566352285988991946436148652839391593178736624957214917527759574235133666461988355855613377789115472297915429318142824465141688559333787512328799783539285826471818279818457674417354335454395644435889386297695625378256613558911695145397779576526397241795181294322797687168326696497256684943829666672341162656479563522892141714998477865114944671225898297338685958644728534192317628618817551492975251364233974374724968483637518876583946828819994321129556511537619253381981544394112184655586964655164192552352534626295996968762388827294873362719636616182786976922445125551927969267591395292198155775434997827738862786341543524544822321112131815475829945625787561369956264826651461575948462782869972654343749617939132353399334744265286151177931594514857563664329299713436914721119746932159456287267887878779218815883191236858656959258484139254446341"); break; case 2: Day2.TestDay2(); break; case 3: Day3.TestDay3(265149); break; case 4: Day4.TestDay4(); break; case 5: Day5.TestDay5(); break; case 6: Day6.TestDay6(); break; case 7: Day7.TestDay7(); break; case 8: Day8.TestDay8(); break; case 9: Day9.TestDay9(); break; case 10: Day10.TestDay10(); break; case 11: Day11.TestDay11(); break; case 12: Day12.TestDay12(); break; case 13: Day13.TestDay13(); break; case 14: Day14.TestDay14(); break; case 15: Day15.TestDay15(); break; case 16: Day16.TestDay16(); break; case 17: Day17.TestDay17(); break; case 18: Day18.TestDay18(); break; case 19: Day19.TestDay19(); break; case 20: Day20.TestDay20(); break; case 21: Day21.TestDay21(); break; case 22: Day22.TestDay22(); break; case 23: Day23.TestDay23(); break; case 24: Day24.TestDay24(); break; case 25: Day25.TestDay25(); break; default: break; } return; }
static void Main(string[] args) { if (args.Length == 0) { Console.WriteLine("Need to specify day number (1-25)"); } else { Console.WriteLine($"Day {args[0]}"); if (args[0] == "1") { Console.WriteLine("Problem 1"); Console.WriteLine(Day1.Problem1("1122")); Console.WriteLine(Day1.Problem1("1111")); Console.WriteLine(Day1.Problem1("1234")); Console.WriteLine(Day1.Problem1("57276274387944537823652626177853384411146325384494935924454336611953119173638191671326254832624841593421667683474349154668177743437745965461678636631863541462893547616877914914662358836365421198516263335926544716331814125295712581158399321372683742773423626286669759415959391374744214595682795818615532673877868424196926497731144319736445141728123322962547288572434564178492753681842244888368542423832228211172842456231275738182764232265933625119312598161192193214898949267765417468348935134618964683127194391796165368145548814473129857697989322621368744725685183346825333247866734735894493395218781464346951777873929898961358796274889826894529599645442657423438562423853247543621565468819799931598754753467593832328147439341586125262733737128386961596394728159719292787597426898945198788211417854662948358422729471312456437778978749753927251431677533575752312447488337156956217451965643454445329758327129966657189332824969141448538681979632611199385896965946849725421978137753366252459914913637858783146735469758716752765718189175583956476935185985918536318424248425426398158278111751711911227818826766177996223718837428972784328925743869885232266127727865267881592395643836999244218345184474613129823933659422223685422732186536199153988717455568523781673393698356967355875123554797755491181791593156433735591529495984256519631187849654633243225118132152549712643273819314433877592644693826861523243946998615722951182474773173215527598949553185313259992227879964482121769617218685394776778423378182462422788277997523913176326468957342296368178321958626168785578977414537368686438348124283789748775163821457641135163495649331144436157836647912852483177542224864952271874645274572426458614384917923623627532487625396914111582754953944965462576624728896917137599778828769958626788685374749661741223741834844643725486925886933118382649581481351844943368484853956759877215252766294896496444835264357169642341291412768946589781812493421379575569593678354241223363739129813633236996588711791919421574583924743119867622229659211793468744163297478952475933163259769578345894367855534294493613767564497137369969315192443795512585")); Console.WriteLine(); Console.WriteLine("Problem 2"); Console.WriteLine(Day1.Problem2("1212")); Console.WriteLine(Day1.Problem2("1221")); Console.WriteLine(Day1.Problem2("123425")); Console.WriteLine(Day1.Problem2("123123")); Console.WriteLine(Day1.Problem2("12131415")); Console.WriteLine(Day1.Problem2("57276274387944537823652626177853384411146325384494935924454336611953119173638191671326254832624841593421667683474349154668177743437745965461678636631863541462893547616877914914662358836365421198516263335926544716331814125295712581158399321372683742773423626286669759415959391374744214595682795818615532673877868424196926497731144319736445141728123322962547288572434564178492753681842244888368542423832228211172842456231275738182764232265933625119312598161192193214898949267765417468348935134618964683127194391796165368145548814473129857697989322621368744725685183346825333247866734735894493395218781464346951777873929898961358796274889826894529599645442657423438562423853247543621565468819799931598754753467593832328147439341586125262733737128386961596394728159719292787597426898945198788211417854662948358422729471312456437778978749753927251431677533575752312447488337156956217451965643454445329758327129966657189332824969141448538681979632611199385896965946849725421978137753366252459914913637858783146735469758716752765718189175583956476935185985918536318424248425426398158278111751711911227818826766177996223718837428972784328925743869885232266127727865267881592395643836999244218345184474613129823933659422223685422732186536199153988717455568523781673393698356967355875123554797755491181791593156433735591529495984256519631187849654633243225118132152549712643273819314433877592644693826861523243946998615722951182474773173215527598949553185313259992227879964482121769617218685394776778423378182462422788277997523913176326468957342296368178321958626168785578977414537368686438348124283789748775163821457641135163495649331144436157836647912852483177542224864952271874645274572426458614384917923623627532487625396914111582754953944965462576624728896917137599778828769958626788685374749661741223741834844643725486925886933118382649581481351844943368484853956759877215252766294896496444835264357169642341291412768946589781812493421379575569593678354241223363739129813633236996588711791919421574583924743119867622229659211793468744163297478952475933163259769578345894367855534294493613767564497137369969315192443795512585")); } else if (args[0] == "2") { Console.WriteLine("Problem 1"); Console.WriteLine(Day2.Problem1()); Console.WriteLine("Problem 2"); Console.WriteLine(Day2.Problem2()); } else if (args[0] == "3") { Console.WriteLine("Problem 1"); Console.WriteLine(Day3.Problem1(12)); Console.WriteLine(Day3.Problem1(23)); Console.WriteLine(Day3.Problem1(1024)); Console.WriteLine(Day3.Problem1(325489)); Console.WriteLine("Problem 2"); Console.WriteLine(Day3.Problem2(325489)); } else if (args[0] == "4") { Console.WriteLine("Problem 1"); Console.WriteLine(Day4.Problem1()); Console.WriteLine("Problem 2"); Console.WriteLine(Day4.Problem2()); } else if (args[0] == "5") { Console.WriteLine("Problem 1"); Console.WriteLine(Day5.Problem1()); Console.WriteLine("Problem 2"); Console.WriteLine(Day5.Problem2()); } else if (args[0] == "6") { Console.WriteLine("Problem 1"); Console.WriteLine(Day6.Problem1()); Console.WriteLine("Problem 2"); Console.WriteLine(Day6.Problem2()); } else if (args[0] == "7") { Console.WriteLine("Problem 1"); Console.WriteLine(Day7.Problem1()); Console.WriteLine("Problem 2"); Console.WriteLine(Day7.Problem2()); } else if (args[0] == "8") { Console.WriteLine("Problem 1"); Console.WriteLine(Day8.Problem1()); Console.WriteLine("Problem 2"); Console.WriteLine(Day8.Problem2()); } else if (args[0] == "9") { Console.WriteLine("Problem 1"); Console.WriteLine(Day9.Problem1()); Console.WriteLine("Problem 2"); Console.WriteLine(Day9.Problem2()); } else if (args[0] == "10") { Console.WriteLine("Problem 1"); Console.WriteLine(Day10.Problem1()); Console.WriteLine("Problem 2"); Console.WriteLine(Day10.Problem2()); } else if (args[0] == "11") { Console.WriteLine("Problem 1"); Console.WriteLine(Day11.Problem1()); Console.WriteLine("Problem 2"); Console.WriteLine(Day11.Problem2()); } else if (args[0] == "12") { Console.WriteLine("Problem 1"); Console.WriteLine(Day12.Problem1()); Console.WriteLine("Problem 2"); Console.WriteLine(Day12.Problem2()); } else if (args[0] == "13") { Console.WriteLine("Problem 1"); Console.WriteLine(Day13.Problem1()); Console.WriteLine("Problem 2"); Console.WriteLine(Day13.Problem2()); } else if (args[0] == "14") { Console.WriteLine("Problem 1"); Console.WriteLine(Day14.Problem1()); Console.WriteLine("Problem 2"); Console.WriteLine(Day14.Problem2()); } else if (args[0] == "15") { Console.WriteLine("Problem 1"); Console.WriteLine(Day15.Problem1(516, 190)); Console.WriteLine("Problem 2"); Console.WriteLine(Day15.Problem2(516, 190)); } else if (args[0] == "16") { Console.WriteLine("Problem 1"); Console.WriteLine(Day16.Problem1()); Console.WriteLine("Problem 2"); Console.WriteLine(Day16.Problem2()); } else if (args[0] == "17") { Console.WriteLine("Problem 1"); Console.WriteLine(Day17.Problem1()); Console.WriteLine("Problem 2"); Console.WriteLine(Day17.Problem2()); } else if (args[0] == "18") { Console.WriteLine("Problem 1"); Console.WriteLine(Day18.Problem1()); Console.WriteLine("Problem 2"); Console.WriteLine(Day18.Problem2()); } else if (args[0] == "19") { Console.WriteLine("Problem 1"); Console.WriteLine(Day19.Problem1()); Console.WriteLine("Problem 2"); Console.WriteLine(Day19.Problem2()); } else if (args[0] == "20") { Console.WriteLine("Problem 1"); Console.WriteLine(Day20.Problem1()); Console.WriteLine("Problem 2"); Console.WriteLine(Day20.Problem2()); } else if (args[0] == "21") { Console.WriteLine("Problem 1"); Console.WriteLine(Day21.Problem1()); Console.WriteLine("Problem 2"); Console.WriteLine(Day21.Problem2()); } else if (args[0] == "22") { Console.WriteLine("Problem 1"); Console.WriteLine(Day22.Problem1()); Console.WriteLine("Problem 2"); Console.WriteLine(Day22.Problem2()); } else if (args[0] == "23") { Console.WriteLine("Problem 1"); Console.WriteLine(Day23.Problem1()); Console.WriteLine("Problem 2"); Console.WriteLine(Day23.Problem2()); } else if (args[0] == "24") { Console.WriteLine("Problem 1"); Console.WriteLine(Day24.Problem1()); Console.WriteLine("Problem 2"); Console.WriteLine(Day24.Problem2()); } else if (args[0] == "25") { Console.WriteLine("Problem 1"); Console.WriteLine(Day25.Problem1()); Console.WriteLine("Problem 2"); Console.WriteLine(Day25.Problem2()); } } }
static void Main(string[] args) { bool repeat = true; Console.WriteLine("ADVENT OF CODE 2016"); Console.WriteLine("#######GODJUL#######"); while (repeat) { Console.Write("Select day(1-25, 0 to exit): "); string day = Console.ReadLine(); Console.WriteLine(); switch (day) { case "1": Day1 day1 = new Day1(); day1.Run(); break; case "2": Day2 day2 = new Day2(); day2.Run(); break; case "3": Day3 day3 = new Day3(); day3.Run(); break; case "4": Day4 day4 = new Day4(); day4.Run(); break; case "5": Day5 day5 = new Day5(); day5.Run(); break; case "6": Day6 day6 = new Day6(); day6.Run(); break; case "7": Day7 day7 = new Day7(); day7.Run(); break; case "0": repeat = false; break; default: break; } Console.WriteLine(); } Console.WriteLine("hej då"); Console.ReadKey(); }
public static void SafeSolve(string input) { try { if (ValidateInput(input)) { Console.WriteLine($"Solving day {SafeGetDay(input)}, part {SafeGetPart(input)}"); switch (input) { case "1.1": Day1.Solve("Data/D1P1.txt"); break; case "1.2": Day1.Solve("Data/D1P1.txt", true); break; case "2.1": Day2.Solve("Data/D2P1.txt"); break; case "2.2": Day2.Solve("Data/D2P1.txt", true); break; case "3.1": Day3.Solve("Data/D3P1.txt", true); break; case "4.1": Day4.Solve("Data/D4P1.txt"); break; case "4.2": Day4.Solve("Data/D4P1.txt", true); break; case "5.1": Day5.Solve("Data/D5P1.txt"); break; case "5.2": Day5.Solve("Data/D5P1.txt", true); break; case "7.1": Day7.Solve("Data/D7P1.txt"); break; case "7.2": Day7.Solve("Data/D7P1.txt", true); break; default: Console.WriteLine("No puzzle found for specified date. Try again."); break; } } } catch (Exception e) { Console.WriteLine($"We done goofed on day {SafeGetDay(input)}. " + e.Message); } }
static void Main(string[] args) { Day1 day1Instance = new Day1(); Day2 day2Instance = new Day2(); Day3 day3Instance = new Day3(); Day4 day4Instance = new Day4(); Day5 day5Instance = new Day5(); Day6 day6Instance = new Day6(); /********************** Day - 1 **********************/ int productOfYears = 0; bool firstPart = true; /* Part 1 */ productOfYears = day1Instance.findProductof2020(firstPart); /* Part 2 */ firstPart = false; productOfYears = day1Instance.findProductof2020(firstPart); /* ------------------------------------------------------ */ /********************** Day - 2 **********************/ int totalNumPasswords = 0; firstPart = true; /* Part 1 */ totalNumPasswords = day2Instance.findTotalRightPasswords(firstPart); /* Part 2 */ firstPart = false; totalNumPasswords = day2Instance.findTotalRightPasswords(firstPart); /* ------------------------------------------------------ */ /********************** Day-3 **********************/ long numTrees = 0; /* Part-1 */ numTrees = day3Instance.findNumTrees(3, 1); /* Part-2 */ numTrees = day3Instance.findNumTrees(1, 1) * day3Instance.findNumTrees(3, 1) * day3Instance.findNumTrees(5, 1) * day3Instance.findNumTrees(7, 1) * day3Instance.findNumTrees(1, 2); /* ------------------------------------------------------ */ /********************** Day-4 **********************/ int numValidPassports = 0; int numOfDataValid = 0; /* Part-1 */ firstPart = true; numValidPassports = day4Instance.findTotalValidPassports(firstPart); /* Part-2 */ firstPart = false; numOfDataValid = day4Instance.findTotalValidPassports(firstPart); /* ------------------------------------------------------ */ /********************** Day-5 **********************/ int highestSeatId = 0; int mySeat = 0; /* Part-1 */ highestSeatId = day5Instance.checkHighestID(); /* Part-2 */ mySeat = day5Instance.checkMySeat(); /* ------------------------------------------------------ */ /********************** Day-5 **********************/ int numOfAnswered = 0; int numOfQuesAllAnswered = 0; /* Part-1 */ firstPart = true; numOfAnswered = day6Instance.checkSumOfCounts(firstPart); /* Part-2 */ firstPart = false; numOfQuesAllAnswered = day6Instance.checkSumOfCounts(firstPart); /* ------------------------------------------------------ */ }