11. Cosmic Nim


General Description

When this program is run, rows of unpleasant alien heads appear on the left of the screen. The idea of the game is to play against the computer, destroying as many of the heads as you like, but endeavouring to manoeuvre the computer into the position where it is left with run remaining head. If you have problems running this on a Model A, remove all spaces.

Detailed Description

   Lines 1-2 When the program is first run, there will be no error and the commands in Line 2 will be executed. However, when the instructions have been read, the instructions will then be deleted (Lines 1050-1200) and this will cause an error in Line 2 the next time the program is run, so it will jump to Line 10.
   Do not press the Escape key during the program's execution because this will cause it to jump to Line 10 and it might run out of memory at 10, so it will get into a continuous loop. To get out of this press Break key and then type OLD.
   10-210 Sets variables, colours and characters
   220-260 Operates the procedures.
   270-440 Displays heads and whether you have won or lost.
   450-480 Is there only 1 head left? If so, user has won.
   490-590 Is there only 1 row left? If so, leave row with 1 and say the computer has won.
   600-620 Procedure to take away heads.
   630 If all rows are there take 1 away from Random row.
   640-660 Two rows are left, redefine rows for computer as D (X) where X is from 1-2, but leave old rows there.
   670-690 If one row has 1 then take everything away from other row and say that the computer has won.
   700 2 left in each row, take 1 away from Random row.
   710-720 Make both rows have same amount of heads.
   830-1040 Move alien up right-hand side of screen and fire torpedoes.
   1050-1140 Instructions.
   1150-1180 Redefine function key fo to delete the instructions and then run program again e.g. Delete 1050, 1200 (carriage return), Run (carriage return). See description of lines 1-2 for more details.
1181-1189 Credits.

Educational Notes

Whilst enormously entertaining in its own right, Cosmic Nim is a taxing logical exercise which, yet again, seems to defeat vast hordes of adults and present no problems for the majority of students.