- The snake begins as a single bone in the middle of the screen.
- The player selects a direction for the snake to move (up, down, left or right) using the arrow keys
- If the snake encounters food, it grows by one bone
- If the snake hits itself, it dies
- If the snake hits the side of the domain, it dies
- Food appears at the start of the game in a random location on the screen
- Each time a piece of food is eaten, another piece of food appears at a random location on the screen
Where we are going there are no roads (/walkthroughs). But, the Short Snake walkthrough provides a good base from which to build on.
A fully working version of the code is, however, provided here, and we recommend all coders execute this code (and play a few games) to get familiar with how the game works.