Tweetmaze challenge
20th December 2015
Here's a challenge for the festive season: write the shortest possible Lisp program that solves a Tweetmaze.
What's a Tweetmaze? It's a logic maze puzzle consisting of a string of decimal digits, so named because you can send it in a tweet. For example, here's a 16-digit Tweetmaze:
You start from the first digit on the left, and the aim is to find a route to the last digit on the right in the shortest number of jumps. The number on each square tells you how far you can jump from that square, left or right, to the next square. So, for example, from the 7 on the starting square you can jump to the first 2 to its right.
The program should accept the maze as a string or list; for example:
"7347737258493420"
It should return the solution as a list of the squares you visit, referring to the leftmost square as 0 and the rightmost square as 15.
The program should work for an arbitrary Tweetmaze, and not depend on a feature of this specific example.
I'll give the answer to this Tweetmaze, together with the best Lisp program, at the beginning of next month.
Another maze
Here's another slightly trickier Tweetmaze:
or as a string:
"2649572484342750"
I'll give the answer to this next month too.
blog comments powered by Disqus