Ejemplo n.º 1
0
        public static int GetDay20Part1Answer()
        {
            // In your maze, how many steps does it take to get from the open
            // tile marked AA to the open tile marked ZZ?
            // Answer: 588
            var mazeDefinition = GetDay20Input();
            var maze           = new DonutMaze(mazeDefinition);

            maze.DrawMaze();
            var pathResult = GetShortestPathThroughMaze(maze);
            var pathString = GetPathString(pathResult, maze);

            Console.WriteLine(pathString);
            return(pathResult.TotalPathCost);
        }
Ejemplo n.º 2
0
        public static int GetDay20Part2Answer()
        {
            // In your maze, when accounting for recursion, how many steps
            // does it take to get from the open tile marked AA to the open
            // tile marked ZZ, both at the outermost layer?
            // Answer: 6834
            var mazeDefinition = GetDay20Input();
            var maze           = new DonutMaze(mazeDefinition, isRecursive: true);

            maze.DrawMaze();
            var pathResult = GetShortestPathThroughMaze(maze);
            var pathString = GetPathString(pathResult, maze);

            Console.WriteLine(pathString);
            return(pathResult.TotalPathCost);
        }