Homework 3 Information, ECS50 Summer 2008

Assignment:

Snake

The purpose of this assignment is to learn more about the use of interrupts, and to write a larger program in assembly language. Both are skills that can come in handy in the future. In order to develop these skills, you are going to design a game similar to the QBasic Nibbles game; it’s also known as Snakes. There are specifications which everyone's games must follow, and a list of options of which you must complete (2). You can complete additional options for extra credit.

Game Description:

In this game you are a snake which collects items (the numbers 1 – 9) in each level. Each number is generated after the previous is collected (e.g. 3 is collected by the snake and then 4 is generated), and the numbers are randomly placed on the game board (but not where the snake currently resides.) The head of the snake will be represented by a capital ‘S’, while the body is made of small letter s's. As each number is collected the snake will grow in length by one ASCII character. Further, the snake is continually moving, and cannot touch itself, or the edge of the game board. The edge of the game board will be represented by an ‘*’ - this character represents a solid barrier that the snake cannot go through. The snake will be moved via the following keys: • • •
•
 I – Up K – Down J – Left L – Right
If you attempt to reverse direction (e.g. you are going up and you press ‘K’) you essentially run into yourself and die. In other words you are only allowed to make 90 degree turns. After collecting all numbers 1 – 9 the player wins the game/level.

Here is a very crude asci drawing of what your screen might look like during play.

*************************
*                       *
*    ssssss             *
*         s             *
*         ssS   4       *
*                       *
*                       *
*************************
In essence you are doing the version of the game in the bottom right hand of the welcome screen at http://www.snakegame.net/, and then adding as many cool new things as you want.
Here are the specifications that are required:

Here are the options which you need to choose two or more: