Compucolor.org – Virtual Media

Listing of file='NIM.BAS;01' on disk='vmedia/ncc_23-sector.ccvf'

1 PRINT CHR$ (12):PRINT TAB( 27)"N I M"
2 PRINT TAB( 20)"A TRADITIONAL GAME"
3 PRINT TAB( 8)"AS DESCRIBED IN DICKSON'S THEORY OF NUMBERS"
5 FOR K= 1TO 1000:NEXT K
10 PRINT CHR$ (12)
20 A= 1
100 PRINT "THE FIRST PLAYERS CHOOSES A NUMBER OF X'S FROM 1-60."
110 PRINT "EACH PLAYER BEGINNING WITH THE SECOND REMOVES 1,2, OR 3 X'S."
120 PRINT :PRINT "THE PLAYER TO TAKE THE LAST X WINS."
130 PRINT :PRINT
140 INPUT "HOW MANY X'S DO YOU WANT? ";N
200 PLOT 3,1,15
210 FOR K= 1TO N:PRINT "X";:NEXT K
220 PRINT :PRINT
230 PRINT "HOW MANY X'S DO YOU WISH TO REMOVE?"
235 IF A< > INT (A/ 2)* 2THEN INPUT "SECOND PLAYER   ";M
236 IF A= INT (A/ 2)* 2THEN INPUT "FIRST PLAYER   ";M
240 IF M> 3OR M< 1THEN PRINT "TAKE 1, 2 OR 3.  TRY AGAIN."
250 IF M> 3OR M< 1THEN GOTO 220
260 A= A+ 1
270 FOR K= 16TO 29:PLOT 3,0,K
280 PRINT "                                      "
290 NEXT K
300 N= N- M
310 IF N< = 0THEN GOTO 400
320 PLOT 3,1,15
325 IF A> = 1AND A< 8THEN PLOT 16+ A
326 IF A> 15AND A< 24THEN PLOT 1+ A
327 IF A< 16AND A> 7THEN PLOT 9+ A
328 IF A> 23AND A< 32THEN PLOT A- 7
330 FOR K= 1TO N:PRINT "X";:NEXT K
340 PRINT "     "
350 IF N> 0THEN GOTO 220
400 PLOT 3,20,27
410 PRINT "YOU WIN!   YOU WIN!"
420 INPUT "DO YOU WANT TO PLAY AGAIN? (Y OR N)";Y$
430 IF Y$= "Y"THEN GOTO 1
440 LOAD "MENU":RUN