I was reading Godel, Escher, Bach: An Eternal Golden Braid on the train and when reading about the MU puzzle I decided to give it a go. I wrote most of the code on my lil’ eeepc, but I did get a bit stuck with the recursion, it was hard to get the apply-rules function to return the answer once it found a path to “MU”.
In the end with some help from the good folks in #emacs and #lisp I had it working here’s the code:
Now when Emacs ground to a halt trying to solve the puzzle, beach pointed out that it was actually impossible and it’s explained later in the book… whoops! Anyway, I thought it was a nifty little program so I thought I’d post it anyway.
(Try replacing “MU” with something that is possible to find to see it in action.)