Exemplo n.º 1
0
        private static void RunPuzzleB()
        {
            // Intro message.
            Console.WriteLine("--- Begin Day 15 - Puzzle B ---");
            Console.WriteLine();

            // Prompt for input.
            Console.Write("Enter Generator A Start Value: ");
            int generatorAStartValue = Convert.ToInt32(Console.ReadLine());

            Console.Write("Enter Generator B Start Value: ");
            int generatorBStartValue = Convert.ToInt32(Console.ReadLine());

            Console.Write("Enter Number of Iterations: ");
            int numberOfIterations = Convert.ToInt32(Console.ReadLine());

            PerformanceTimer.Start();

            int result = PuzzleB.GeneratorJudge.JudgeGenerators(
                generatorAStartValue,
                generatorBStartValue,
                numberOfIterations);

            PerformanceTimer.Stop();

            // Display results.
            Console.WriteLine();
            Console.WriteLine($"Puzzle B result: {result}");
            PerformanceTimer.LogTime();

            Console.WriteLine();
        }
Exemplo n.º 2
0
        private static void RunPuzzleA()
        {
            // Intro message.
            Console.WriteLine("--- Begin Day 10 - Puzzle A ---");
            Console.WriteLine();

            // Prompt for input.
            Console.Write("Enter number of elements: ");
            int numberOfElements = Convert.ToInt32(Console.ReadLine());

            Console.Write("Enter puzzle input: ");
            string lengths = Console.ReadLine();

            PerformanceTimer.Start();

            int result = PuzzleA.HashGenerator.GenerateHashFromLengths(
                numberOfElements,
                lengths);

            PerformanceTimer.Stop();

            // Display results.
            Console.WriteLine();
            Console.WriteLine($"Puzzle A result: {result}");
            PerformanceTimer.LogTime();

            Console.WriteLine();
        }
Exemplo n.º 3
0
        private static void RunPuzzleA()
        {
            // Intro message.
            Console.WriteLine("--- Begin Day 18 - Puzzle A ---");

            PerformanceTimer.Start();

            long result = PuzzleA.SoundProcessor.GetFirstRecoveredFrequency(@"Input\puzzlea.txt");

            PerformanceTimer.Stop();

            // Display results.
            Console.WriteLine();
            Console.WriteLine($"Puzzle A result: {result}");
            PerformanceTimer.LogTime();

            Console.WriteLine();
        }
Exemplo n.º 4
0
        private static void RunPuzzleB()
        {
            // Intro message.
            Console.WriteLine("--- Begin Day 18 - Puzzle B ---");

            PerformanceTimer.Start();

            long result = PuzzleB.InstructionProcessor.GetNumberOfValuesSent(@"Input\puzzleb.txt");

            PerformanceTimer.Stop();

            // Display results.
            Console.WriteLine();
            Console.WriteLine($"Puzzle B result: {result}");
            PerformanceTimer.LogTime();

            Console.WriteLine();
        }
Exemplo n.º 5
0
        private static void RunPuzzleB()
        {
            // Intro message.
            Console.WriteLine("--- Begin Day 24 - Puzzle B ---");

            PerformanceTimer.Start();

            int result = PuzzleB.BridgeBuilder.DetermineStrengthOfLongestBridge(@"Input\puzzleb.txt");

            PerformanceTimer.Stop();

            // Display results.
            Console.WriteLine();
            Console.WriteLine($"Puzzle B result: {result}");
            PerformanceTimer.LogTime();

            Console.WriteLine();
        }
Exemplo n.º 6
0
        private static void RunPuzzleA()
        {
            // Intro message.
            Console.WriteLine("--- Begin Day 23 - Puzzle A ---");

            PerformanceTimer.Start();

            long result = PuzzleA.InstructionProcessor.GetTimesMulWasUsed(@"Input\puzzlea.txt");

            PerformanceTimer.Stop();

            // Display results.
            Console.WriteLine();
            Console.WriteLine($"Puzzle A result: {result}");
            PerformanceTimer.LogTime();

            Console.WriteLine();
        }
Exemplo n.º 7
0
        private static void RunPuzzleB()
        {
            // Intro message.
            Console.WriteLine("--- Begin Day 19 - Puzzle B ---");

            PerformanceTimer.Start();

            int result = PuzzleB.PathFollower.CountSteps(@"Input\puzzleb.txt");

            PerformanceTimer.Stop();

            // Display results.
            Console.WriteLine();
            Console.WriteLine($"Puzzle B result: {result}");
            PerformanceTimer.LogTime();

            Console.WriteLine();
        }
Exemplo n.º 8
0
        private static void RunPuzzleB()
        {
            // Intro message.
            Console.WriteLine("--- Begin Day 23 - Puzzle B ---");

            PerformanceTimer.Start();

            int result = PuzzleB.InstructionProcessor.FindCompositesBetweenTwoNumbers(106700, 123700);

            PerformanceTimer.Stop();

            // Display results.
            Console.WriteLine();
            Console.WriteLine($"Puzzle B result: {result}");
            PerformanceTimer.LogTime();

            Console.WriteLine();
        }
Exemplo n.º 9
0
        private static void RunPuzzleA()
        {
            // Intro message.
            Console.WriteLine("--- Begin Day 19 - Puzzle A ---");

            PerformanceTimer.Start();

            string result = PuzzleA.PathFollower.FollowPath(@"Input\puzzlea.txt");

            PerformanceTimer.Stop();

            // Display results.
            Console.WriteLine();
            Console.WriteLine($"Puzzle A result: {result}");
            PerformanceTimer.LogTime();

            Console.WriteLine();
        }
Exemplo n.º 10
0
        private static void RunPuzzleA()
        {
            // Intro message.
            Console.WriteLine("--- Begin Day 7 - Puzzle A ---");
            Console.WriteLine();

            PerformanceTimer.Start();

            string result = PuzzleA.TowerBuilder.FindBottomProgram(@"Input\puzzlea.txt");

            PerformanceTimer.Stop();

            // Display results.
            Console.WriteLine($"Puzzle A result: {result}");
            PerformanceTimer.LogTime();

            Console.WriteLine();
        }
Exemplo n.º 11
0
        private static void RunPuzzleA()
        {
            // Intro message.
            Console.WriteLine("--- Begin Day 4 - Puzzle A ---");

            PerformanceTimer.Start();

            int result = PuzzleA.FileParser.CountValidPassphrases(@"Input\puzzlea.txt");

            PerformanceTimer.Stop();

            // Display results.
            Console.WriteLine();
            Console.WriteLine($"Puzzle A result: {result}");
            PerformanceTimer.LogTime();

            Console.WriteLine();
        }
Exemplo n.º 12
0
        private static void RunPuzzleB()
        {
            // Intro message.
            Console.WriteLine("--- Begin Day 8 - Puzzle B ---");
            Console.WriteLine();

            PerformanceTimer.Start();

            int result = PuzzleB.RegisterManager.FindLargestValueEver(@"Input\puzzleb.txt");

            PerformanceTimer.Stop();

            // Display results.
            Console.WriteLine($"Puzzle B result: {result}");
            PerformanceTimer.LogTime();

            Console.WriteLine();
        }
Exemplo n.º 13
0
        private static void RunPuzzleA()
        {
            // Intro message.
            Console.WriteLine("--- Begin Day 20 - Puzzle A ---");
            Console.WriteLine();

            PerformanceTimer.Start();

            int result = PuzzleA.ParticleSimulator.FindClosestParticle(@"Input\puzzlea.txt");

            PerformanceTimer.Stop();

            // Display results.
            Console.WriteLine($"Puzzle A result: {result}");
            PerformanceTimer.LogTime();

            Console.WriteLine();
        }
Exemplo n.º 14
0
        private static void RunPuzzleA()
        {
            // Intro message.
            Console.WriteLine("--- Begin Day 5 - Puzzle A ---");

            PerformanceTimer.Start();

            int result = PuzzleA.JumpCalculator.CalculateJumpsToEscape(@"Input\puzzlea.txt");

            PerformanceTimer.Stop();

            // Display results.
            Console.WriteLine();
            Console.WriteLine($"Puzzle A result: {result}");
            PerformanceTimer.LogTime();

            Console.WriteLine();
        }
Exemplo n.º 15
0
        private static void RunPuzzleB()
        {
            // Intro message.
            Console.WriteLine("--- Begin Day 20 - Puzzle B ---");
            Console.WriteLine();

            PerformanceTimer.Start();

            int result = PuzzleB.ParticleSimulator.FindNumberOfNonCollisions(@"Input\puzzleb.txt");

            PerformanceTimer.Stop();

            // Display results.
            Console.WriteLine($"Puzzle B result: {result}");
            PerformanceTimer.LogTime();

            Console.WriteLine();
        }
Exemplo n.º 16
0
        private static void RunPuzzleA()
        {
            // Intro message.
            Console.WriteLine("--- Begin Day 13 - Puzzle A ---");

            PerformanceTimer.Start();

            int result = PuzzleA.FirewallTraveler.CheckSeverityForPacket(@"Input\puzzlea.txt");

            PerformanceTimer.Stop();

            // Display results.
            Console.WriteLine();
            Console.WriteLine($"Puzzle A result: {result}");
            PerformanceTimer.LogTime();

            Console.WriteLine();
        }
Exemplo n.º 17
0
        private static void RunPuzzleB()
        {
            // Intro message.
            Console.WriteLine("--- Begin Day 7 - Puzzle B ---");
            Console.WriteLine();

            PerformanceTimer.Start();

            int result = PuzzleB.TowerBuilder.FindBalancingWeight(@"Input\puzzleb.txt");

            PerformanceTimer.Stop();

            // Display results.
            Console.WriteLine($"Puzzle B result: {result}");
            PerformanceTimer.LogTime();

            Console.WriteLine();
        }
Exemplo n.º 18
0
        private static void RunPuzzleB()
        {
            // Intro message.
            Console.WriteLine("--- Begin Day 13 - Puzzle B ---");
            Console.WriteLine();

            PerformanceTimer.Start();

            int result = PuzzleB.FirewallTraveler.FindShortestDelay(@"Input\puzzleb.txt");

            PerformanceTimer.Stop();

            // Display results.
            Console.WriteLine();
            Console.WriteLine($"Puzzle B result: {result}");
            PerformanceTimer.LogTime();

            Console.WriteLine();
        }
Exemplo n.º 19
0
        private static void RunPuzzleB()
        {
            // Intro message.
            Console.WriteLine("--- Begin Day 2 - Puzzle B ---");
            Console.WriteLine();

            PerformanceTimer.Start();

            int result = PuzzleB.FileParser.ComputeFileChecksum(@"Input\puzzleb.txt");

            PerformanceTimer.Stop();

            // Display results.
            Console.WriteLine();
            Console.WriteLine($"Puzzle B result: {result}");
            PerformanceTimer.LogTime();

            Console.WriteLine();
        }
Exemplo n.º 20
0
        private static void RunPuzzleA()
        {
            // Intro message.
            Console.WriteLine("--- Begin Day 12 - Puzzle A ---");
            Console.WriteLine();

            PerformanceTimer.Start();

            int result = PuzzleA.PipeTraveler.FindConnectionsToZero(@"Input\puzzlea.txt");

            PerformanceTimer.Stop();

            // Display results.
            Console.WriteLine();
            Console.WriteLine($"Puzzle A result: {result}");
            PerformanceTimer.LogTime();

            Console.WriteLine();
        }
Exemplo n.º 21
0
        private static void RunPuzzleB()
        {
            // Intro message.
            Console.WriteLine("--- Begin Day 16 - Puzzle B ---");

            PerformanceTimer.Start();

            string result = PuzzleB.ProgramTracker.TrackProgramPositions(
                @"Input\puzzleb.txt",
                "abcdefghijklmnop");

            PerformanceTimer.Stop();

            // Display results.
            Console.WriteLine();
            Console.WriteLine($"Puzzle B result: {result}");
            PerformanceTimer.LogTime();

            Console.WriteLine();
        }
Exemplo n.º 22
0
        private static void RunPuzzleB()
        {
            // Intro message.
            Console.WriteLine("--- Begin Day 21 - Puzzle B ---");
            Console.WriteLine();

            PerformanceTimer.Start();

            int result = PuzzleA.ArtGenerator.FindNumberOfOnCells(
                @"Input\puzzlea.txt",
                18);

            PerformanceTimer.Stop();

            // Display results.
            Console.WriteLine($"Puzzle B result: {result}");
            PerformanceTimer.LogTime();

            Console.WriteLine();
        }
Exemplo n.º 23
0
        private static void RunPuzzleB()
        {
            // Intro message.
            Console.WriteLine("--- Begin Day 22 - Puzzle B ---");
            Console.WriteLine();

            PerformanceTimer.Start();

            int result = PuzzleB.VirusTracker.CalculateBurstsWithInfection(
                @"Input\puzzlea.txt",
                10000000);

            PerformanceTimer.Stop();

            // Display results.
            Console.WriteLine($"Puzzle B result: {result}");
            PerformanceTimer.LogTime();

            Console.WriteLine();
        }
Exemplo n.º 24
0
        private static void RunPuzzleB()
        {
            // Intro message.
            Console.WriteLine("--- Begin Day 5 - Puzzle B ---");
            Console.WriteLine();

            // Prompt for input.
            Console.Write("Enter puzzle input: ");
            string numericString = Console.ReadLine();

            PerformanceTimer.Start();

            int result = PuzzleB.JumpCalculator.CalculateJumpsToEscape(@"Input\puzzleb.txt");

            PerformanceTimer.Stop();

            // Display results.
            Console.WriteLine();
            Console.WriteLine($"Puzzle B result: {result}");
            PerformanceTimer.LogTime();

            Console.WriteLine();
        }
Exemplo n.º 25
0
        private static void RunPuzzleA()
        {
            // Intro message.
            Console.WriteLine("--- Begin Day 14 - Puzzle A ---");
            Console.WriteLine();

            // Prompt for input.
            Console.Write("Enter puzzle input: ");
            string key = Console.ReadLine();

            PerformanceTimer.Start();

            int result = PuzzleA.SquareGenerator.FindUsedSquares(key);

            PerformanceTimer.Stop();

            // Display results.
            Console.WriteLine();
            Console.WriteLine($"Puzzle A result: {result}");
            PerformanceTimer.LogTime();

            Console.WriteLine();
        }
Exemplo n.º 26
0
        private static void RunPuzzleB()
        {
            // Intro message.
            Console.WriteLine("--- Begin Day 17 - Puzzle B ---");
            Console.WriteLine();

            // Prompt for input.
            Console.Write("Enter puzzle input: ");
            int stepNumber = Convert.ToInt32(Console.ReadLine());

            PerformanceTimer.Start();

            int result = PuzzleB.SpinlockGenerator.GetShortCircuitValue(stepNumber);

            PerformanceTimer.Stop();

            // Display results.
            Console.WriteLine();
            Console.WriteLine($"Puzzle B result: {result}");
            PerformanceTimer.LogTime();

            Console.WriteLine();
        }
Exemplo n.º 27
0
        private static void RunPuzzleB()
        {
            // Intro message.
            Console.WriteLine("--- Begin Day 4 - Puzzle B ---");
            Console.WriteLine();

            // Prompt for input.
            Console.Write("Enter puzzle input: ");
            string numericString = Console.ReadLine();

            PerformanceTimer.Start();

            int result = PuzzleB.FileParser.CountValidPassphrases(@"Input\puzzleb.txt");

            PerformanceTimer.Stop();

            // Display results.
            Console.WriteLine();
            Console.WriteLine($"Puzzle B result: {result}");
            PerformanceTimer.LogTime();

            Console.WriteLine();
        }
Exemplo n.º 28
0
        private static void RunPuzzleB()
        {
            // Intro message.
            Console.WriteLine("--- Begin Day 3 - Puzzle B ---");
            Console.WriteLine();

            // Prompt for input.
            Console.Write("Enter puzzle input: ");
            string numericString = Console.ReadLine();

            PerformanceTimer.Start();

            int result = PuzzleB.SpiralCalculator.GetLargerThan(Convert.ToInt32(numericString));

            PerformanceTimer.Stop();

            // Display results.
            Console.WriteLine();
            Console.WriteLine($"Puzzle B result: {result}");
            PerformanceTimer.LogTime();

            Console.WriteLine();
        }
Exemplo n.º 29
0
        private static void RunPuzzleB()
        {
            // Intro message.
            Console.WriteLine("--- Begin Day 14 - Puzzle B ---");
            Console.WriteLine();

            // Prompt for input.
            Console.Write("Enter puzzle input: ");
            string inputString = Console.ReadLine();

            PerformanceTimer.Start();

            int result = PuzzleB.SquareGenerator.FindUniqueRegions(inputString);

            PerformanceTimer.Stop();

            // Display results.
            Console.WriteLine();
            Console.WriteLine($"Puzzle B result: {result}");
            PerformanceTimer.LogTime();

            Console.WriteLine();
        }
Exemplo n.º 30
0
        private static void RunPuzzleA()
        {
            // Intro message.
            Console.WriteLine("--- Begin Day 25 - Puzzle A ---");
            Console.WriteLine();

            // Prompt for input.
            Console.Write("Enter puzzle input: ");
            long stepValue = Convert.ToInt64(Console.ReadLine());

            PerformanceTimer.Start();

            long result = PuzzleA.TuringMachine.GetDiagnosticChecksum(stepValue);

            PerformanceTimer.Stop();

            // Display results.
            Console.WriteLine();
            Console.WriteLine($"Puzzle A result: {result}");
            PerformanceTimer.LogTime();

            Console.WriteLine();
        }