Lecture notes for the Introduction to Computer Science I by James Tam | Return to the course web page |
Ranges | Letter |
23 - 24 | A+ |
21 - 22 | A |
19 - 20 | A- |
17 - 18 | B+ |
15 - 16 | B |
13 - 14 | B- |
11 - 12 | C+ |
9 - 10 | C |
6 - 8 | C- |
3 - 5 | D+ |
2 | D |
1 | D- |
0 | F |
You are write the code for the "Squirt the weed" game. The game will model a garden in which weeds randomly sprout up and the player must 'squirt' a location before a weed grows there. (That is, the player must predict where weeds may sprout up in the future). The 'garden' will be implemented as a two dimensional character array. Time passes in the game in the form of turns. During each turn the game will display the state of the garden from the previous turn. The player will be prompted for the row and column coordinates of the square that he or she wishes to squirt. Each turn the player can only squirt one square. In the full game there will be a maximum of 8 weeds under the soil that sprout up each turn. At the start of the turn the weeds will retract (i.e., the square is cleared) and the program will randomly determine the new location for each weed to appear. If the player correctly predicted where a weed sprouts, the weed has been 'squirted' and won't re-grow the next turn (the maximum number of weeds that sprout up the next turn will be reduced by one). The game continues on a turn-by-turn basis until: 1) Fifty turns have elapsed 2) The player quits the game 3) The player has 'won' the game - he or she has successfully predicted where all the weeds will sprout (the player has squirted all eight weeds) |
Once you complete all the features of the basic assignment you can complete the extra features for additional credit (make sure you backup your work first and don't touch the working back up, modify a copy instead!) Unless there are technical considerations you can complete these extra features in whatever order or combination that you desire. (For example: It's makes no sense to let the player win the game if he or she can't even select a square to squirt).
|
|
|
|
|
|
To help make sure that you haven't missed anything here is a checklist of items to be used in marking. A sample executable 'weed' can be found in UNIX under the directory: /home/231/tamj/assignments/assignment7.
Clipart image from: http://www.revelation-illustrated.com