Solve a Hopido puzzle

From Rosetta Code
Revision as of 13:24, 30 May 2014 by Nigel Galloway (talk | contribs) (Created page with "{{draft task}} Hopido puzzles are similar to Hidato. The most important difference is that the only moves allowed are: hop over one tile diagonall...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Solve a Hopido puzzle is a draft programming task. It is not yet considered ready to be promoted as a complete task, for reasons that should be found in its talk page.

Hopido puzzles are similar to Hidato. The most important difference is that the only moves allowed are: hop over one tile diagonally; and over two tiles horizontally and vertically. It should be possible to start anywhere in the path, the end point isn't indicated and there are no intermediate clues. Hopido Design Post Mortem contains the following:

"Big puzzles represented another problem. Up until quite late in the project our puzzle solver was painfully slow with most puzzles above 7×7 tiles. Testing the solution from each starting point could take hours. If the tile layout was changed even a little, the whole puzzle had to be tested again. We were just about to give up the biggest puzzles entirely when our programmer suddenly came up with a magical algorithm that cut the testing process down to only minutes. Hooray!"

Knowing the kindness in the heart of every contributor to Rosetta Code I know that we shall feel that as an act of humanity we must solve these puzzles for them in let's say milliseconds.

Example:

. 0 0 . 0 0 .
0 0 0 0 0 0 0
0 0 0 0 0 0 0
. 0 0 0 0 0 .
. . 0 0 0 . .
. . . 0 . . .

The task is to write a program which will prove that it is possible to reach every node in the above example moving as described above starting at every point in the example. If you can find a path whose end point is a leagal move from the start point you may conclude that it is possible to complete it from every point without exhausting every possible start point.

Extra credits are available for other interesting designs.