In the grid below, start at the A and end at the W, by first moving two positions (horizontally, vertically or diagonally), then by three positions, etc., alternating between 2- and 3-position moves. Never go to the same letter twice (though you may cross over a previous letter) and never reverse directions 180 degrees from one move to the next. Also never land on or even jump over the two hyphens.
For example, a valid start is A-C-P-R, and then the only valid move is the diagonal to B, as you can't backtrack to O, nor go up past the hyphen, nor is there enough room to go down three positions, nor any space to the right. Diagonals are always allowed, not just when you're stuck like this.
A B C D E
F G H I J
K L M N -
- O P Q R
S T U V W
What is the shortest such path? ... and the longest?
(In reply to Solution
Although not affecting the final results, I see that your computer algorithm apparently will go directly to W it it is only one move away, without considering any detours that might be available.
Posted by Charlie
on 2009-03-23 10:41:27