Fwd: Please Forward: Ruby Quiz Submission

Begin forwarded message:

James Edward G. II [email protected] writes:

backtracking works in this version, I might think about that some
more.

cheers
Edward Harman

When I try this solution on the map I’ve been trying all the solutions
on, this happens:

@.*…
…~…
…^.X

#.*…
…~…
…###

That is, not only does it try to go over the mountain, it manages to
jump a square, jumping straight from the start at (0,0) to the
mountain at (2,2).

The culprit for going over the mountain instead of going through the
forest is almost certainly the manhattan distance, as it is in other
solutions. I have no idea why it jumps a square.