A sample program that demonstrates how a small game can be written in JavaScript.
The program uses some features of JavaScript that are not described in the beginner
lessons such as: arrays, creating simple objects, OR, for loops, windows, graphics,
keyboard input, and comments. As an exercise, here are some possible modifications
that you may want to make to the game: create a different layout of walls, make the
game go faster, change the graphics for the snake, make it possible to have the
snake go off the end of one side of the screen and then appear on the other side.