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
re: Solution by Charlie)
Well, the final step each time does seem to be from either T or U, but, in fact, my algorithm was designed to find all possible routes and it came up with only those 8.
Although it would seem possible to make the final step from G or M, it appears that whenever you reach those points either the next step length is wrong or you would be turning through 180 degrees.
|
Posted by Harry
on 2009-03-24 19:38:10 |