Apple's "Adventure" sample code, unchanged, so it's easy to fork. NOT WRITTEN BY ME!