The following simple example illustrates the idea. Start in the top left corner and find the shortest route to the target in the bottom right corner:

Initially the length of your jump is 2, so from the starting cell you can jump two cells to the right or two cells down. If you jump two cells to the right you land on a cell containing +1, so the size of your jumps is increased to 3 and you can't go any further. However, if you jump two cells down you land on a cell containing -1, so now the size of your jumps is reduced to 1 and you can jump one cell to the right, or one cell upwards. Negative jumps aren't allowed.

Continue in this way, and find the shortest route to the goal.

Here's the solution:

The Variable Jumping Maze is a state maze in which you could have to visit the same square n-1 times, where n is the maximum width or height of the maze. We've also updated the Mazelog Maze Walker to extend it to work with the Variable Jumping Mazes.

Got the idea? Now try your hand at the Four maze.

]]>