Elimination

See all articles from SYNC v2 n5
Author(s): A. Dan Klyver
Publication: SYNC
Pub Details: SYNC v2 n5 (Volume 2, Issue 5)
Date: September/October 1982
Pages: 54

Elimination is a traditional dice game which provides a worthwhile vehicle for teaching young children (and others) simple strategy, an understanding of odds, and the mental manipulation of numbers. Consequently, it helps reinforce arithmetic skills since the player’s ability to use mental arithmetic is pitted against the computer’s problem posing ability. Although the game is fun to play alone, a group can play by each taking a turn and keeping score to see who can do the best job of eliminating numbers.

Enter the program in Listing 1 and hit NEWLINE. The numbers 1 to 9 will appear together with the randomly produced results of a dice roll. You are prompted to make a choice(s) of which number or numbers you wish to eliminate in the range of 1 to 9. See Figure 1. The total of the numbers selected for elimination must equal the total of the dice role. For example, if on the first roll of the game, you roll a 5 and a 4, you may eliminate a 9 or any combination of numbers totaling 9.

The object of the game is to eliminate all of the numbers. The selection of a given number or combination of numbers is up to the player, but the odds of rolling any particular number should be considered when making the selection.

After making the selection, hit NEWLINE. The selected numbers will become zero(s). This will indicate that they have been eliminated and cannot be played again. The results of a new dice roll will also be displayed. The game proceeds with the next selection.

Improper entries will result in early termination of the game (a penalty for making a mistake). When the game is approaching the end, a roll that is not compatible with the remaining numbers will terminate the game with the total of the remaining numbers being displayed as the score. The lowest number wins.

To play again, hit NEWLINE. To revert to the program listing, enter four letters and hit NEWLINE. After a “win” is scored (all numbers eliminated), the program will be listed again.

4K ROM Version

The program listing is for the 8K ROM, but it can be adapted to the 4K ROM by making the following changes:

 110 RANDOMISE
120 LET X=RND(6)
140 LET Y=RND(6)
180 PRINT "ENTER YOUR CHOICE(S)
ONE AT A TIME EACH FOLLOWED B
Y ENTER"
200 IF NOT B(Q)=Q THEN GOTO 270
220 IF NOT B(R)=R THEN GOTO 270
240 IF NOT S=B(S) THEN GOTO 270
260 IF NOT T=B(T) THEN GOTO 270
330 PRINT "GAME OVER, TO REPLAY
HIT ENTER"
450 IF NOT B(A)=0 THEN GOTO 50

Listing 1. Elimination (8K ROM).

  10 DIM B(9)
20 FOR A=1 TO 9
30 LET B(A)=A
40 NEXT A
50 PRINT "THE NUMBERS TO BE EL
IMINATED ARE"
60 PRINT
70 FOR A=1 TO 9
80 PRINT B(A);" ";
90 NEXT A
100 PRINT
110 RAND
120 LET X=INT (RND*6)+1
130 PRINT
140 LET Y=INT (RND*6)+1
150 LET Z=X+Y
160 PRINT "YOU ROLLED A ";X;" A
ND A ";Y
170 PRINT
180 PRINT "ENTER YOUR CHOICE(S)
ONE AT A TIME EACH FOLLOWED B
Y N/L"
190 INPUT Q
200 IF B(Q)<>Q THEN GOTO 270
205 IF Q=Z THEN GOTO 420
210 INPUT R
220 IF B(R)<>R THEN GOTO 270
225 IF R+Q=Z THEN GOTO 410
230 INPUT S
240 IF S<>B(S) THEN GOTO 270
245 IF Q+R+S=Z THEN GOTO 400
250 INPUT T
260 IF T<>B(T) THEN GOTO 270
265 IF Q+R+S+T=Z THEN GOTO 390
270 PRINT
280 LET V=0
290 PRINT
300 FOR P=1 TO 9
310 LET V=V+B(P)
320 NEXT P
330 PRINT "GAME OVER, TO REPLAY
HIT N/L"
340 PRINT
350 PRINT "SCORE=";V
360 INPUT G$
370 CLS
380 GOTO 10
390 LET B(T)=0
400 LET B(S)=0
410 LET B(R)=0
420 LET B(Q)=0
430 CLS
440 FOR A=1 TO 9
450 IF B(A)<>0 THEN GOTO 50
460 NEXT A
470 PRINT "YOU WIN"

Figure 1. Sample Run.

THE NUMBERS TO BE ELIMINATED ARE
0 0 0 0 0 0 0 8 0
YOU ROLLED A 1 AND A  1
ENTER YOUR CHOICE(S) ONE AT A
TIME EACH FOLLOWED BY N/L
GAME OVER, TO REPLAY HIT N/L
SCORE=8

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.