AI exercises: Puzzle

Ugh my Scheme is rusty. Lots of uglyness for the sake of just getting
it over with.