Write a basic version of the snake game.

The way our game works is by first creating a green square at the center of the screen. The snake should be moving to the right. If you hit an arrow key, you should change the snake’s direction.

Hints

You are going to need some way to keep track of the snake’s current direction between functions!

Use constants!

When a key is pressed, if it is an arrow key, change the direction of the snake.

When the snake moves, it should move one square in the direction it is currently facing.

When the snake moves, it should leave a trail of green squares behind it.

If the snake hits the edge of the screen, it should wrap around to the other side.

If the snake hits itself, the game should end.