A Clojure Snake
The Snake game features a player-controlled snake that moves around a game grid hunting for an apple. When your snake eats an apple, it grows longer by a segment, and a new apple appears. If your snake reaches a certain length, you win. But if your snake crosses over its own body, you lose.
Before you start building your own snake, take a minute to try the completed version. From the book’s REPL, enter the following:
Select the Snake window, and use the arrow keys to control your snake.
Our design for the snake is going to take advantage of Clojure’s functional nature and its ...