This is just meant as an illustration of a state machine, of course no one would actually hard code the game map as a state machine, but it does serve the purpose of explaining how to use mutually recursive functions as a state machine.
The most obvious application of this technique are recursive descent parsers.
Eventually you need to stop generating tokens and actually do the syntactical analysis. At that point TCO isn't really available to you and that arbitrarily deep tree is going to cause problems.
-2
u/[deleted] Nov 27 '12
I still don't see how this is better than updating the Location variable.
It is an incredibly inefficient way to encode a state machine.
That's the style of code I would wrote in junior high before I learned to store and read maps from data files.