The Best of Creative Computing Volume 1 (published 1976)

Page 253 << PREVIOUS >> NEXT Jump to page:
Go to contents Go to thumbnails

Not One (BASIC computer game, dice, BASIC program listing, sample run)

graphic of page

NOT ONE

In the Nov-Dec 74 issue of Creative Computing, we challenged readers to write a
good version of the game NOT ONE. Of the many versions received, the one printed
below appears to be one of the best. It is by Robert Puopolo, Belmont Hill
School, Belmont, Mass.

Complete playing instructions are given in the computer program itself. If you
convert this to your version of BASIC, be alert for multiple statements on one
line (separated by a colon) and extended IF statements (for example,
lF-THEN-PRINT or IF-THEN-PRINT-ELSE-PRINT).

***
5 REM ROBERT PUOPOL0 bELHONT HILL 6/25/74 "NOTONE"

7 PRINT:PRINT TAB(15);"NOTONE":PRINT
10 DIM T(50),R(10),C(10),L(12)
13 RANDOMIZE
15 INPUT "WOULD YOU LIKE THE INSTRUCTIONS";A$
20 IF A$="YES" THEN 35
25 IF A$="NO" THEN 100
30 PRINT:PRINT "ANSWER YES OR N0!!":PRINT:GOTO 15
35 PRINT:PRINT "THE GAME OF NOTONE IS PLAYED WITH"

40 PRINT "TWO PLAYERS AND A PAIR OF DICE. THERE ARE"

45 PRINT "TEN ROUNDS IN THE GAME. ONE ROUND CONSISTING"

50 PRINT "OF ONE TURN FOR EACH PLAYER. PLAYERS"

55 PRINT "(YOURSELF AND THE COMPUTER) ADD THE SCORE"

60 PRINT "THEY ATTAIN ON EACH ROUND. AND THE PLAYER"

62 PRINT "WITH THE HIGHEST SCORE AFTER TEN ROUNDS IS THE WINNER":PRINT
67 PRINT "ON EACH TURN THE PLAYER MAY ROLL THE TWO"

69 PRINT "DICE FROM 1 TO N TIMES. IF T1 IS THE TOTAL OF DICE ON"

72 PRINT "THE ITH ROLL, THEN THE PLAYERS SCORE FOR THE TURN IS"

75 PRINT "T(1)+T(2)+T(3)+.........+T(N). HOWEVER,"

77 PRINT "AND HERE'S THE CATCH. IF ANY T(I)IS EQUAL TO T(1) THEN "

80 PRINT "THE TURN IS OVER AND HIS SCORE FOR THAT ROUND IS ZERO"

82 PRINT "AFTER EACH ROLL THAT DOESN'T EQUAL T(1), THE PLAYER CAN "

88 PRINT "DECIDE WHETHER TO ROLL AGAIN OR STOP AND"

90 PRINT "SCORE THE NUMBER OF POINTS ALREADY OBTAINED."

100 FOR T=1 TO 10:PRINT:PRINT "ROUND ";T
110 X=X+1:R1=INT(6*RND(X))+1
115 R2=INT(6*RND(X))+1:PRINT R1+R2
120 IF X>1 THEN 130
125 T(1)=R1+R2:GOTO 135
130 T(X)=R1+R2:IF T(1)=T(X) THEN
        PRINT "YOU GET A ZERO FOR THIS ROUND":X,T1=0:GOTO 200
135 T1=T1+T(X)
140 INPUT "ROLL AGAIN ";B$
145 IF B$="YES" THEN 110
150 IF B$="NO" THEN R(T)=T1:X,T1=0:T(A)=0 FOR A=1 TO 50:G0TO 200
160 PRINT:PRINT "ANSWER YES OR NO!!":PRINT:GOTO 140
200 PRINT:PRINT TAB(15%);"COMPUTERS MOVE":PRINT
201 RESTORE
202 R1=INT(6*RND(X))+1:R2=INT(6*RND(X))+1
204 READ L(D) FOR D=2 TO R1+R2
205 FOR C=1 TO L(D):IF C=1 THEN 215
210 R1=INT(6*RND(X))+1:R2=INT(6*RND(X))+1
215 PRINT "COMPUTER'S ROLL"C":";R1+R2
220 IF C>1 THEN 230
225 T(1)=R1+R2:GOTO 242
230 T(C)=R1+R2
235 IF T(C)=T(1) THEN PRINT "THE COMPUTER GETS A ZERO FOR THE TURN"

:T1=0
:GOTO 245
242 T1=T1+T(C):NEXT C
245 C(T)=T1:X,T1=0
250 C2=C2+C(T):C1=C1+R(T)
253 PRINT:T(B)=0 FOR B=1 TO 50
255 IF T=10 THEN PRINT "FINAL SCORE":PRINT
260 IF C2>C1 THEN PRINT "COMPUTER: ";C2,"YOU: ";C1 ELSE
PRINT "YOU: ";C1,"COMPUTER: ";C2
300 NEXT T
305 DATA 18,18,9,9,6,6,6,9,9,18,18
310 PRINT:PRINT "SCORING SUMMARY":PRINT
315 PRINT TAB(17);"YOU":PRINT
320 PRINT E,R(E) FOR E=1 TO 10:PRINT:PRINT "TOTAL: ";C1:PRINT
325 PRINT TAB(17);"COMPUTER":PRINT
330 PRINT E,C(E) FOR E=1 TO 10:PRINT:PRINT "TOTAL: ";C2:PRINT
***
NOTONE
WOULD YOU LIKE THE INSTRUCTIONS? YES

THE GAME OF NOTONE IS PLAYED WITH TWO PLAYERS AND A PAIR OF DICE. THERE ARE TEN
ROUNDS IN THE GAME. ONE ROUND CONSISTING OF ONE TURN FOR EACH PLAYER.  PLAYERS
(YOURSELF AND THE COMPUTER) ADD THE SCORE THEY ATTAIN ON EACH ROUND, AND THE
PLAYER WITH THE HIGHEST SCORE AFTER TEN ROUNDS IS THE WINNER

ON EACH TURN THE PLAYER MAY ROLL THE TWO DICE FROM 1 TO N TIMES. IF T1 IS THE
TOTAL OF DICE ON THE ITH ROLL, THEN THE PLAYERS SCORE FOR THE TURN IS
T(1)+T(2)+T(3)+.........+T(N). HOWEVER, AND HERE'S THE CATCH, IF ANY T(I)IS
EQUAL TO T(1) THEN THE TURN IS OVER AND HIS SCORE FOR THAT ROUND IS ZERO.  AFTER
EACH ROLL THAT DOESN'T EQUAL T(1), THE PLAYER CAN DECIDE WHETHER TO ROLL AGAIN
OR STOP AND SCORE THE NUMBER OF POINTS ALREADY OBTAINED.

ROUND 1
6
ROLL AGAIN ? YES
4
ROLL AGAIN ? YES
9
ROLL AGAIN ? YES
7
ROLL AGAIN ? YES
11
ROLL AGAIN ? NO

COMPUTERS MOVE

COMPUTER'S ROLL 1 : 5
COMPUTER'S ROLL 2 : 7
COMPUTER'S ROLL 3 : 4
COMPUTER'S ROLL 4 : 6
COMPUTER'S ROLL 5 : 9
COMPUTER'S ROLL 6 : 5
THE COMPUTER GETS A ZERO FOR THE TURN

YOU: 37 COMPUTER: 0

ROUND 2
3
ROLL AGAIN ? YES
9
ROLL AGAIN ? 

ANSWER YES OR NO!!

ROLL AGAIN ? YES
9
ROLL AGAIN ? YES
7
[IMAGE]
ROUND 10
8
ROLL AGAIN ? YES
6
ROLL AGAIN ? YES
10
ROLL AGAIN ? YES
5
ROLL AGAIN ? YES
5
ROLL AGAIN ? NO

COMPUTERS MOVE

COMPUTER'S ROLL 1 : 3
COMPUTER'S ROLL 2 : 4
COMPUTER'S ROLL 3 : 9
COMPUTER'S ROLL 4 : 10
COMPUTER'S ROLL 5 : 8
COMPUTER'S ROLL 6 : 8
COMPUTER'S ROLL 7 : 9
COMPUTER'S ROLL 8 : 7
COMPUTER'S ROLL 9 : 9
COMPUTER'S ROLL 10 : 8
COMPUTER'S ROLL 11 : 6
COMPUTER'S ROLL 12 : 3
THE COMPUTER GETS A ZERO FOR THE TURN

FINAL SCORE

YOU: 345 COMPUTER: 299
***
253

Page 253 << PREVIOUS >> NEXT Jump to page:
Go to contents Go to thumbnails