Imagine you have become a game developer and your manager poses the problem
of developing the first version of the Snake Game.
SNAKE is one of the early computer games that
caught peoples' attention when it first came out.
The player is in control of a snake whose sole purpose in life is to
eat food and to grow bigger. Initially the snake is just one segment
long: the head. When it eats a pile of food, it grows by one segment.
The snake is always on the move (up, down, left, right). When the game
starts, the snake is moving left. At every clock tick, the snake moves
in its current direction by one segment. The player can change this
direction by pressing one of the arrow keys. Naturally if the snake is
already moving in the direction of the pressed key, nothing changes.
When the snake's head is close to the pile of food on the playing
field, the snake eats the food and grows by one segment. That is, the
food disappears, and the snake is extended by one segment at the tail
end. After the food is eaten, a new pile of food appears at some
other, random location on the playing field.
The goal of the game is to grow the snake as large as possible. The
game stops if (1) the snake runs into itself or (2) the snake hit the wall.
Design and implement the game in a step-by-step, bottom-up fashion.

Grading: if you don't follow the design recipe all the way, you will
inflict a lot of punishment on yourself, because you will spend a
tremendous amount of time getting the game to work. In addition, the
graders will punish you a lot. You must design your program in "Beginning
Language with List Abbreviations."
You may find the code from Lecture
18 useful.