Esempio n. 1
0
            public int StepsToExit(JumpAdjustment jumpAdjustment)
            {
                int current = 0;
                int steps   = 0;

                do
                {
                    int jump = jumpOffsets[current];
                    jumpOffsets[current] += jumpAdjustment(jump);
                    current += jump;

                    steps++;
                }while (current >= 0 && current < jumpOffsets.Length);

                return(steps);
            }
Esempio n. 2
0
 private int PerformJumps(JumpAdjustment jumpAdjustment) => new JumpMaze(maze).StepsToExit(jumpAdjustment);