Requires 16K
by David Boh1ke
COMP III is a 'break the code' game similar to Mastermind. In this version, the code to decipher must be a three digit number. The number cannot contain a zero; and repeating decimals are not allowed. COMP III is actually two games. In one portion of the program, the player attempts to guess the computer's number, and play can be reversed with the computer attempting to crack the player's code.
TO begin play, plug a joystick into Slot # 1. Then use the SELECT key to choose the game you wish to play. That is, whether the human or computer will guess the other's number. Next, press the START key to initiate your selection.
There are three responses used as clues to aid you in finding the number - Zip, Par, and Ace. A Zip clue indicates that all three of the digits you have guessed are incorrect. The clue Par means that one digit is correct, but in the wrong location. An Ace indicator means that a digit is both correct and in the proper location. The clues Ace and Par may be used together in several combinations as responses to a given guess.
As an example, suppose the hidden number is 123. Following are several sample guesses with the proper clue responses:
869 | Zip (all digits incorrect) |
437 | Par (one digit correct, but in the wrong location) |
215 | Par, Par (two digits correct, but each in the wrong location) |
826 | Ace (one digit correct and in proper location) |
143 | Ace, Ace (two digits correct and both in the proper location) |
327 | Ace, Par (one digit correct and in proper location, one digit correct and in wrong position) |
231 | Par, Par, Par (all three digits correct, and each in the wrong position) |
321 | Ace, Par, Par (one digit correct and in the proper position, and two digits correct but in the wrong position) |
When you are guessing the computer's number, these clues will be displayed to the right of your guess. If the computer is guessing your number, then this entire list of possible responses will be printed on the screen. You will need to use the joystick to move the cursor along side of the proper response to the computer's guess, then press the Fire button. If the number is not guessed in nine attempts (for either code breaker), a new game will be initiated. The Atari can usually guess your number in four to six tries - and with a little practice you should be able to become just as efficient.
COMP III Listing Description
10-32 | initialization |
20 | A $ (1000) holds possible picks for the computer's guess, B$(5) is used in prints |
27 | set screen display |
30 | get game selection |
32 | branch to player's guess |
45-260 | computer to guess player's number |
45 | initialize array - NG is the number of the guess |
50-90 | pick a random guess from the array |
130 | A,B,C are the digits of the guess |
134-154 | print prompts |
200-222 | get player's response, CP is the position of the cursor |
250-254 | print old guess |
260 | get next guess, loop through sequence |
400-625 | player to guess computer's number |
400-420 | computer selects number to be guessed - GN is the guess number |
422-425 | player didn't get the number in nine attempts |
430-455 | input player's guess |
500-560 | print response for player's guess |
600-625 | STICK controls for player's guess |
700-810 | computer's guess logic |
700 | check each remaining number - X,Y,Z are the possible guess digits |
720 | possible guess if Zip response |
730 | possible guess if Ace response |
740 | possible guess is Par response |
750 | possible guess if Par, Par response |
760 | possible guess if Ace, Ace response |
770 | possible guess if Ace, Par response |
780 | possible guess if Ace, Par, Par response |
790 | possible guess if Par, Par, Par response |
850-870 | initial array A$(N,N) =1101, if number is eliminated by logic in line #720-790, else A$(N,N) = 1 |
900-932 | select game |
950-974 | screen display |