private static void ExecuteDayOne() { List <int> inputNumbers = DayOne.ReadAndProcessFile(); int solutionOne = DayOne.FindPartOneSolution(inputNumbers); int solutionTwo = DayOne.FindPartTwoSolution(inputNumbers); WriteToConsole(solutionOne, solutionTwo); }
static void Main(string[] args) { DayOne day = new DayOne(); DayTwo two = new DayTwo(); DayThree three = new DayThree(); Console.WriteLine(new DayFour().CountValid()); }
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(); }
/// <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; }
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; } }
private static int DayOneTwo() { var inp = InputProvider.DayOne(); return(DayOne.ProblemTwo(inp)); }
static void Main(string[] args) { var dayOne = new DayOne(); Console.WriteLine(dayOne.CalculateSumOfFuel()); }