10 KEY OFF:CLS
20 SCREEN 0
30 WIDTH 40
40 PRINT"???????????????????????????????????????"
50 PRINT"??????????????????????????????????????"
60 PRINT"??                                   ??"
70 PRINT"??            2053-A.BAS             ??"
80 PRINT"??             YAHTZEE               ??"
90 PRINT"??                                   ??"
100 PRINT"??                                   ??"
110 PRINT"?? BROUGHT TO YOU BY THE MEMBERS OF  ??"
120 PRINT"??      ????? ????? ????? ?????      ??"
130 PRINT"??        ?   ?   ? ?     ?   ?      ??"
140 PRINT"??        ?   ????? ?     ?   ?      ??"
150 PRINT"??        ?   ?     ?     ?   ?      ??"
160 PRINT"??      ????? ?     ????? ?????      ??"
170 PRINT"??                                   ??"
180 PRINT"??      International PC Owners      ??"
190 PRINT"??                                   ??"
200 PRINT"??P.O. Box 10426, Pittsburgh PA 15234??"
210 PRINT"??                                   ??"
220 PRINT"??????????????????????????????????????"
230 PRINT"???????????????????????????????????????"
240 PRINT
250 PRINT "       PRESS ANY KEY TO CONTINUE
260 A$=INKEY$: IF A$="" THEN 260
270 WIDTH 80
280 CLS
1000 '     YATZEE
1010 ' ORIGINAL BY JL HELMS & MF PEZOK FOR CCII
1020 ' CORONADO, CA
1030 ' ADAPTED TO IBM PC BY PATRICK LEABO
1040 ' TUCSON, AZ
1050 '
1060 DEFINT A-Z
1070 DIM C(5):DIM K(18,7):DIM F(5):DIM A$(7)
1080 DIM S(6,5):DIM M(13),TN(6),DU(6):KEY OFF:COLOR 7,0:WIDTH 80
1090 SCREEN 0,1:RESTORE 1150:FOR N= 1 TO 6:READ TN(N):NEXT
1100 COMMON MENU
1110 GOSUB 5110
1120 C1= 39:C2= 63:C3= 33:C4= 56
1130 GOSUB 4680
1140 CLS:GOSUB 4450
1150 DATA 49,51,53,54,56,61
1160 GOSUB 6820:REM  draw yatzee board
1170 RANDOMIZE VAL(RIGHT$(TIME$,2))
1180 LOCATE 25,1
1190 PRINT "HOW MANY PLAYERS?  ";:LOCATE ,,1:GOSUB 2110
1200 GOSUB 7100: N=ASC(KB$)-48
1210 IF N< 1 OR N> 5 THEN 1180
1220 IF N< 5 THEN GOSUB 6020
1230 IF CC= 1 THEN GOSUB 5500
1240 FOR A= 1 TO N
1250 LOCATE 25,1:PRINT STRING$(70," ");:LOCATE 25,1
1260 PRINT "PLAYER NUMBER"A;"NAME PLEASE  ";
1270 GOSUB 2110:LINE INPUT ;A$(A):IF A$(A)= "" THEN BEEP:GOTO 1250
1280 A$(A)=LEFT$(A$(A),9)
1290 NEXT A
1300 IF CC= 1 THEN N= N+ 1:A$(N)= "IBM PC"
1310 LOCATE 23,1
1320 A= 0
1330 REM 
1340 REM   NEXT ROLL PRESET
1350 REM  
1360 A= A+ 1:IF A> N THEN A= 1
1370 H= 0:GOSUB 5360
1380 IF A= 0 THEN 4780
1390 IF K(18,A)= 2 THEN 1360
1400 LOCATE 23,1:PRINT STRING$(60," ");
1410 LOCATE 23,4* (A- 1)+ 14
1420 PRINT A$(A);
1430 REM 
1440 REM   INITIAL ROLL
1450 REM  
1460 H= H+ 1:MR= 0
1470 FOR B= 1 TO 5
1480 J= B- 1:C(B)= INT (6* RND (1)+ 1)
1490 DIE= C(B):F(B)= 0
1500 GOSUB 5270
1510 GOSUB 5550
1520 NEXT B
1530 IF A* CC= N THEN 2160
1540 REM 
1550 REM  PLAYER SELECTS QTY TO ROLL
1560 REM 
1570 GOSUB 7080
1580 IF H> 2 THEN 1960
1590 POKE 106,0:PRINT " HOW MANY DICE TO ROLL AGAIN? ";:LOCATE ,,1:GOSUB 2100:GOSUB 7100:F$=KB$:PRINT F$;:F=ASC(F$)-48:LOCATE ,,0
1600 IF F= - 1 THEN GOSUB 7080
1610 IF F< 0 OR F> 5 THEN 1570
1620 IF F= 0 THEN 1960
1630 IF F= 5 THEN 1430
1640 REM 
1650 REM  PLAYER SELECTS DICE TO ROLL
1660 REM 
1670 H= H+ 1
1680 GOSUB 7080
1690 FOR NN= 1 TO 4:F(NN)= 0:NEXT 
1700 IF F>1 THEN 1720
1710 PRINT " ROLL WHICH";F;"DIE AGAIN?  ";:LOCATE ,,1:GOTO 1730
1720 PRINT " ROLL WHICH";F;"DICE AGAIN   ";:LOCATE ,,1
1730 GOSUB 2110:FOR ND= 1 TO F:
1740 GOSUB 7100:F$=KB$::F(ND)= ASC(F$)- 48:GOSUB 2140:IF F(ND)= 0 AND  ND= 1 THEN  ND= F:GOTO 1760
1750 IF F(ND)< 1 OR  F(ND)> 5 THEN 1740
1760 PRINT F(ND);:NEXT
1770 X= 2:XF= 0
1780 FOR J= 1 TO F
1790 IF F= 1 THEN 1810
1800 IF F(J)= F(J+ 1)THEN X= 1
1810 IF F(1)= 0 THEN XF= 1
1820 NEXT J:IF XF= 1 THEN H= H- 1:GOTO 1570
1830 ON X GOTO 1680,1840
1840 REM  
1850 REM  PLAYER ROLLS DICE AGAIN
1860 REM 
1870 FOR B= 1 TO 4
1880 IF F(B)= 0 THEN 1940
1890 C(F(B))= INT (6* RND (1)+ 1)
1900 DIE= C(F(B)):J= F(B)- 1
1910 GOSUB 5270
1920 GOSUB 5550
1930 F(B)= 0
1940 NEXT B
1950 GOTO 1540
1960 REM 
1970 REM   PLAY BOARD NUMBER
1980 REM 
1990 GOSUB 7080
2000 PRINT " PLAY BOARD NUMBER?  ";:LOCATE ,,1:GOSUB 2100:GOSUB 7100:I$=KB$:I=ASC(I$)- 48:LOCATE ,,0:IF I> 9 THEN I= I- 7
2010 GOSUB 2140:IF I> 9 THEN PRINT CHR$ (I+ 55);:GOTO 2030
2020 PRINT I;
2030 IF I< 1 OR I> 13 THEN 1990
2040 IF I= 12 AND K(12,A)> - 1 THEN 2160
2050 IF K(I,A)= 0 THEN 2160
2060 LOCATE 24,1:BEEP
2070 PRINT "NO - NO - DUMMY - - TRY AGAIN";:FOR ND=1 TO 1500:NEXT:LOCATE 24,1:PRINT STRING$(60," ");
2080 LOCATE 25,1:PRINT STRING$(60," ");:LOCATE 25,1
2090 GOTO 2000
2100 REM  HIGH PITCH CLICK
2110 PLAY "L64T200N70":RETURN
2120 REM  GLISSANDO SOUND
2130 PLAY "MBt255MLL64O5CC#DD#EFF#GG#AA#B":RETURN
2140 ' LO PITCH CLICK
2150 PLAY "L64T200N46":RETURN
2160 REM  
2170 REM  DICE LOGIC
2180 REM  CLEAR/SET S(M,K)
2190 REM  
2200 FOR M= 0 TO 6
2210 FOR K= 0 TO 5
2220 S(M,K)= 0
2230 NEXT K
2240 NEXT M
2250 FOR J= 1 TO 5
2260 X= C(J):S(X,0)= S(X,0)+ 1
2270 P= S(X,0):S(X,P)= J
2280 NEXT J
2290 REM  
2300 REM  SET S(0,K)=M SEQUENCE BY QTY
2310 REM  
2320 X= 0
2330 FOR J= 5 TO 1 STEP - 1
2340 FOR M= 6 TO 1 STEP - 1
2350 IF S(M,0)< > J THEN 2370
2360 S(0,X)= M:X= X+ 1
2370 NEXT M
2380 NEXT J
2390 IF A* CC= N THEN 2760
2400 IF I> 6 THEN 2480
2410 REM  
2420 REM  CHECK PLAYER BOARD 1-6
2430 REM  
2440 GOSUB 6110
2450 IF X= - 1 THEN 2740
2460 K(I,A)= I* S(S(0,X),0)
2470 GOTO 4000
2480 REM  
2490 REM  CHECK PLAYER BOARD 7-13
2500 REM  
2510 ON I- 6 GOTO 2520,2540,2560,2580,2630,2670,2700
2520 IF S(S(0,0),0)< 3 THEN 2740
2530 GOSUB 6190:GOTO 4000
2540 IF S(S(0,0),0)< 4 THEN 2740
2550 GOSUB 6190:GOTO 4000
2560 IF S(S(0,0),0)< > 3 OR S(S(0,1),0)< > 2 THEN 2740
2570 K(9,A)= 25:GOTO 4000
2580 IF S(1,0)> 0 AND S(2,0)> 0 AND S(3,0)> 0 AND S(4,0)> 0 THEN 2620
2590 IF S(2,0)> 0 AND S(3,0)> 0 AND S(4,0)> 0 AND S(5,0)> 0 THEN 2620
2600 IF S(3,0)> 0 AND S(4,0)> 0 AND S(5,0)> 0 AND S(6,0)> 0 THEN 2620
2610 GOTO 2740
2620 K(10,A)= 30:GOTO 4000
2630 IF S(1,0)AND S(2,0)AND S(3,0)AND S(4,0)AND S(5,0)= 1 THEN 2660
2640 IF S(2,0)AND S(3,0)AND S(4,0)AND S(5,0)AND S(6,0)= 1 THEN 2660
2650 GOTO 2740
2660 K(11,A)= 40:GOTO 4000
2670 IF S(S(0,0),0)< > 5 THEN 2740
2680 IF K(12,A)= 0 THEN K(12,A)= 50:GOTO 4000
2690 K(12,A)= K(12,A)+ 100:GOTO 4000
2700 GOSUB 6190:GOTO 4000
2710 REM  
2720 REM  SET PLAYER INVALID
2730 REM  
2740 K(I,A)= - 1
2750 GOTO 4000
2760 REM  
2770 REM  COMPUTER CHECKS
2780 REM  
2790 I= 12
2800 IF S(S(0,0),0)= 5 AND K(12,A)= 0 THEN K(12,A)= 50:GOTO 4000
2810 IF S(S(0,0),0)= 5 AND K(12,A)> 0 THEN K(12,A)= K(12,A)+ 100:GOTO 4000
2820 I= 8
2830 IF S(S(0,0),0)= 4 AND K(8,A)= 0 THEN GOSUB 6190:GOTO 4000
2840 I= 9
2850 IF S(S(0,0),0)= 3 AND S(S(0,1),0)= 2 AND K(9,A)= 0 THEN K(9,A)= 25:GOTO 4000
2860 IF K(11,A)< > 0 THEN 2920
2870 I= 11
2880 IF S(1,0)AND S(2,0)AND S(3,0)AND S(4,0)AND S(5,0)= 1 THEN 2910
2890 IF S(2,0)AND S(3,0)AND S(4,0)AND S(5,0)AND S(6,0)= 1 THEN 2910
2900 GOTO 2920
2910 K(11,A)= 40:GOTO 4000
2920 IF K(10,A)< > 0 THEN 2990
2930 I= 10
2940 IF S(1,0)> 0 AND S(2,0)> 0 AND S(3,0)> 0 AND S(4,0)> 0 THEN 2980
2950 IF S(2,0)> 0 AND S(3,0)> 0 AND S(4,0)> 0 AND S(5,0)> 0 THEN 2980
2960 IF S(3,0)> 0 AND S(4,0)> 0 AND S(5,0)> 0 AND S(6,0)> 0 THEN 2980
2970 GOTO 2990
2980 K(10,A)= 30:GOTO 4000
2990 IF H< 3 THEN 3160
3000 I= 6
3010 IF S(6,0)> 2 AND K(6,A)= 0 THEN K(6,A)= 6* S(6,0):GOTO 4000
3020 I= 5
3030 IF S(5,0)> 2 AND K(5,A)= 0 THEN K(5,A)= 5* S(5,0):GOTO 4000
3040 I= 4
3050 IF S(4,0)> 2 AND K(4,A)= 0 THEN K(4,A)= 4* S(4,0):GOTO 4000
3060 I= 3
3070 IF S(3,0)> 2 AND K(3,A)= 0 THEN K(3,A)= 3* S(3,0):GOTO 4000
3080 I= 7
3090 IF S(S(0,0),0)> 2 AND K(7,A)= 0 THEN GOSUB 6190:GOTO 4000
3100 I= 2
3110 IF S(2,0)> 2 AND K(2,A)= 0 THEN K(2,A)= 2* S(2,0):GOTO 4000
3120 I= 1
3130 IF S(1,0)> 2 AND K(1,A)= 0 THEN K(1,A)= S(1,0):GOTO 4000
3140 I= 13:IF K(13,A)< > 0 THEN 3160
3150 IF C(1)+ C(2)+ C(3)+ C(4)+ C(5)> 19 THEN GOSUB 6190:GOTO 4000
3160 REM  
3170 REM  CLEAR DICE NUMBER F(B)
3180 REM  COMPUTER
3190 REM  
3200 FOR B= 1 TO 5
3210 F(B)= 0
3220 NEXT B
3230 REM  
3240 REM  GET DICE CONTROL
3250 REM  COMPUTER
3260 REM  
3270 H= H+ 1:IF H> 3 THEN 3860
3280 I= M(MR):IF I< > 0 THEN 3310
3290 MR= MR+ 1:IF MR> 13 THEN MR= 1
3300 GOTO 3280
3310 IF I= 12 AND K(12,A)> - 1 THEN 3350
3320 IF K(I,A)< > 0 THEN 3290
3330 IF I= 9 THEN 3460
3340 IF I= 10 OR I= 11 THEN 3580
3350 REM  
3360 REM  GET DICE 1,2,3,4
3370 REM  COMPUTER
3380 REM  
3390 M= 0:J= 1
3400 M= M+ 1:IF M> 4 THEN 3740
3410 K= S(0,M):IF K= 0 THEN 3740
3420 FOR L= 1 TO S(K,0)
3430 F(J)= S(K,L):J= J+ 1
3440 NEXT L
3450 GOTO 3400
3460 REM  
3470 REM  GET DICE FH
3480 REM  COMPUTER
3490 REM  
3500 M= 0:J= 1
3510 M= M+ 1:IF M> 4 THEN 3740
3520 K= S(0,M):IF K= 0 THEN 3740
3530 IF K> 1 THEN 3510
3540 FOR L= 1 TO S(K,0)
3550 F(J)= S(K,L):J= J+ 1
3560 NEXT L
3570 GOTO 3510
3580 REM  
3590 REM  GET DICE LG/SM ST
3600 REM  COMPUTER
3610 REM  
3620 M= 0:J= 1
3630 M= M+ 1:IF M> 4 THEN 3700
3640 K= S(0,M):IF K= 0 THEN 3700
3650 IF S(K,0)= 1 THEN 3630
3660 FOR L= 1 TO S(K,0)
3670 F(J)= S(K,L):J= J+ 1
3680 NEXT L
3690 GOTO 3630
3700 IF F(1)< > 0 THEN 3740
3710 L= INT (2* RND (1)+ 1)
3720 F(1)= 5
3730 IF L= 1 THEN F(1)= 1
3740 REM  
3750 REM  COMPUTER ROLL AGAIN
3760 REM  
3770 FOR B= 1 TO 4
3780 IF F(B)< 1 THEN 3830
3790 C(F(B))= INT (6* RND (1)+ 1)
3800 DIE= C(F(B)):J= F(B)- 1
3810 GOSUB 5270
3820 GOSUB 5550
3830 F(B)= 0
3840 NEXT B
3850 GOTO 2160
3860 REM  
3870 REM  COMPUTER MUST SCORE
3880 REM  
3890 MR= MR+ 1:IF MR> 13 THEN MR= 1
3900 I= M(MR):IF I= 0 THEN 3890
3910 IF K(I,A)< > 0 THEN 3890
3920 IF I> 6 THEN 3980
3930 GOSUB 6110
3940 IF X= - 1 THEN 3990
3950 IF K(I,A)< > 0 THEN 3890
3960 K(I,A)= S(I,0)* I
3970 IF K(I,A)< > 0 THEN 4000
3980 IF I= 13 AND K(13,A)= 0 THEN GOSUB 6190
3990 IF K(I,A)= 0 THEN K(I,A)= - 1
4000 REM  
4010 REM  GET SCOREBOARD TOTALS
4020 REM  
4030 FOR J= 14 TO 17
4040 K(J,A)= 0
4050 NEXT J
4060 FOR J= 1 TO 6
4070 IF K(J,A)< 0 THEN 4090
4080 K(15,A)= K(15,A)+ K(J,A)
4090 NEXT J
4100 IF K(15,A)> 62 THEN K(14,A)= 35
4110 FOR J= 7 TO 13
4120 IF K(J,A)< 0 THEN 4140
4130 K(16,A)= K(16,A)+ K(J,A)
4140 NEXT J
4150 K(17,A)= K(14,A)+ K(15,A)+ K(16,A)
4160 REM  
4170 REM  PRINT SCORE
4180 REM  
4190 GOSUB 2130
4200 COLOR 15,0
4210 FOR J= 1 TO 6
4220 IF K(J,A)< 0 THEN LOCATE J+1,4* (A- 1)+ 15:PRINT "  0";:GOTO 4250
4230 IF K(J,A)< 1 THEN 4250
4240 LOCATE J+1,4* (A- 1)+ 15:PRINT  USING"###";K(J,A);
4250 NEXT J
4260 FOR J= 7 TO 13
4270 IF K(J,A)< 0 THEN LOCATE J+4,4* (A- 1)+ 15:PRINT "  0":GOTO 4300
4280 IF K(J,A)< 1 THEN 4300
4290 LOCATE J+4,4* (A- 1)+ 15:PRINT USING "###";K(J,A)
4300 NEXT J
4310 LOCATE 9,4* (A- 1)+ 15:PRINT USING "###";K(15,A)
4320 LOCATE 19,4* (A- 1)+ 15:PRINT USING "###";K(16,A)
4330 LOCATE 20,4* (A- 1)+ 15:PRINT USING "###";K(14,A)
4340 LOCATE 21,4* (A- 1)+ 15:PRINT USING "###";K(17,A)
4350 COLOR 7,0
4360 IF A* CC< > N THEN 1330
4370 REM  
4380 REM  RESET M(I) COMPUTER PRIORITIES
4390 REM  
4400 FOR B= 1 TO 13
4410 IF M(B)= 12 THEN 4430
4420 IF M(B)= I THEN M(B)= 0
4430 NEXT B
4440 GOTO 1330
4450 REM  
4460 REM   INSTRUCTIONS
4470 REM  
4480 PRINT "            Y A H T Z E E "
4490 PRINT "THIS IS THE GAME OF YAHTZEE - "
4500 PRINT "FROM 1 TO 7 PLAYERS MAY PLAY AT THE SAME TIME"
4510 PRINT "WITH EACH PLAYERS CURRENT STATUS SHOWN ON THE"
4520 PRINT "PLAYING BOARD, INCLUDING TOTAL SCORES"
4530 PRINT 
4540 PRINT "THE ONLY DIFFERENCE BETWEEN THIS GAME AND THE"
4550 PRINT "POPULAR HOME GAME IS THAT YOU MAY GET MULTIPLE"
4560 PRINT "YAHTZEES HERE ..... THE FIRST YAHTZEE SCORES"
4570 PRINT "50 POINTS, AND EACH ADDITIONAL ONE WILL YIELD"
4580 PRINT "A BONUS OF 100 POINTS (IF THE YAHTZEE IS PUT"
4590 PRINT "INTO THE YAHTZEE BLOCK)..... IN ADDITION YOU"
4600 PRINT "WILL BE GIVEN AN EXTRA TURN AT THE END OF"
4610 PRINT "THE GAME":PRINT :PRINT 
4620 PRINT "THE WINNER WILL BE ANNOUNCED AT THE END OF"
4630 PRINT "THE GAME - - BUT I WOULDNT ADVISE ANYONE"
4640 PRINT "TO BE LAST......."
4650 PRINT:PRINT
4660 GOSUB 2110:INPUT "HIT RETURN TO CONTINUE  ";Y$:BEEP
4670 RETURN 
4680 RETURN
4690 LOCATE 10,10:PRINT "YATZEE.BAS     VER 3.2"
4700 LOCATE 12,10:PRINT "27 JUN 79"
4710 LOCATE 14,10:PRINT "DEVELOPED BY"
4720 LOCATE 15,13:PRINT "J.L. HELMS    &    M.F. PEZOK"
4730 LOCATE,16,13:PRINT "1009 LEYTE RD / 1321 SAIPAN RD"
4740 LOCATE 17,17:PRINT "CORONADO,  CA.  92118"
4750 LOCATE 18,15:PRINT "(714) 435-6992 / 437-4659"
4760 PRINT CHR$(11)
4770 RETURN 
4780 REM 
4790 REM   END - SORT WINNER
4800 REM 
4810 X= 2:IF N= 1 THEN 4890
4820 FOR J= 1 TO N- 1
4830 IF K(17,J)> K(17,J+ 1)THEN 4870
4840 K= K(17,J):K(17,J)= K(17,J+ 1):K(17,J+ 1)= K
4850 A$= A$(J):A$(J)= A$(J+ 1):A$(J+ 1)= A$
4860 X= 1
4870 NEXT J
4880 ON X GOTO 4780,4890
4890 REM 
4900 REM   PRINT WINNERS STANDINGS
4910 REM 
4920 RESTORE 5220
4930 FOR J= 1 TO N
4940 LOCATE 25,1:PRINT STRING$(60," ");
4950 IF J> 1 AND J= N THEN RESTORE 5260
4960 LOCATE 25,1:READ A$
4970 PRINT A$;"     ";A$(J);" ";
4980 TT= 500* (N- J+ 1):IF TT< 1500 THEN TT= 1500
4990 FOR T= 1 TO TT:NEXT T
5000 NEXT J
5010 LOCATE 25,1:PRINT STRING$(60," ");
5020 LOCATE 24,1:PRINT "+++   END OF GAME   +++";
5030 FOR T= 1 TO 2000:NEXT T
5040 '
5050 GOSUB 2110:LOCATE 25,1:PRINT "PLAY AGAIN?  Y/N  ";
5060 Y$=INKEY$:IF Y$=""THEN GOTO 5060
5070 IF Y$="Y" OR Y$="y" THEN GOSUB 5110:GOTO 1110
5080 IF Y$="N" OR Y$="n" THEN BEEP:GOTO 5100
5090 GOTO 5060
5100 CHAIN "MENU",1000
5110 REM 
5120 REM   CLEAR MATRICES
5130 REM 
5140 FOR K= 1 TO 7
5150 FOR J= 1 TO 18
5160 K(J,K)= 0
5170 NEXT J
5180 A$(K)= ""
5190 NEXT K
5200 CLS
5210 RETURN 
5220 DATA "+++   THE WINNER   +++"
5230 DATA " SECOND PLACE"," THIRD PLACE "
5240 DATA " FOURTH PLACE "," FIFTH PLACE "
5250 DATA " SIXTH PLACE "
5260 DATA " DEAD LAST "
5270 REM 
5280 REM   ERASE DIE
5290 REM 
5300 COLOR 0,7:PRINT"";:
5310 LOCATE 4* J+ 1,50:PRINT"       ";
5320 LOCATE 4* J+ 2,50:PRINT"       ";
5330 LOCATE 4* J+ 3,50:PRINT"       ";
5340 COLOR 7,0
5350 RETURN 
5360 REM  
5370 REM    CHECK IF DONE
5380 REM  
5390 X= 0
5400 FOR J= 1 TO N
5410 Y= 2
5420 FOR K= 1 TO 13
5430 IF K(K,J)= 0 THEN Y= 1
5440 NEXT K
5450 K(18,J)= Y
5460 IF Y= 2 THEN X= X+ 1
5470 NEXT J
5480 IF X= > N THEN A= 0
5490 RETURN 
5500 REM  
5510 REM  COMPUTER PRIORITIES INFO
5520 REM  
5530 GOSUB 6780
5540 RETURN 
5550 REM 
5560 REM   PRINT DIE
5570 REM 
5580 COLOR 0,7:LOCATE ,,0
5590 REM 
5600 PLAY "L32T200N=TN(DIE);"
5610 ON DIE GOTO 5950,5890,5830,5770,5710,5650
5620 '
5630 '   SIX
5640 '
5650 LOCATE 4*J+1,50:PRINT "";CHR$(32);CHR$(2);CHR$(32);CHR$(2);CHR$(32);CHR$(2);CHR$(32);
5660 LOCATE 4*J+2,50:PRINT CHR$(32);CHR$(32);CHR$(32);CHR$(32);CHR$(32);CHR$(32);CHR$(32);
5670 LOCATE 4*J+3,50:PRINT CHR$(32);CHR$(2);CHR$(32);CHR$(2);CHR$(32);CHR$(2);CHR$(32);:GOTO 5980
5680 '
5690 '   FIVE
5700 '
5710 LOCATE 4*J+1,50:PRINT "";CHR$(32);CHR$(2);CHR$(32);" ";CHR$(32);CHR$(2);" ";
5720 LOCATE 4*J+2,50:PRINT " ";CHR$(32);" ";CHR$(2);" ";CHR$(32);" ";
5730 LOCATE 4*J+3,50:PRINT " ";CHR$(2);" ";CHR$(32);" ";CHR$(2);" ";:GOTO 5980
5740 '
5750 '   FOUR
5760 '
5770 LOCATE 4*J+1,50:PRINT "";" ";CHR$(2);"  ";CHR$(32);CHR$(2);" ";
5780 LOCATE 4*J+2,50:PRINT "   ";CHR$(32);CHR$(32);CHR$(32);
5790 LOCATE 4*J+3,50:PRINT " ";CHR$(2);"  ";CHR$(32);CHR$(2);" ";:GOTO 5980
5800 '
5810 '   THREE
5820 '
5830 LOCATE 4*J+1,50:PRINT "";" ";CHR$(2);"     ";
5840 LOCATE 4*J+2,50:PRINT "   ";CHR$(2);"   ";
5850 LOCATE 4*J+3,50:PRINT "     ";CHR$(2);" ";:GOTO 5980
5860 '
5870 '   TWO
5880 '
5890 LOCATE 4*J+1,50:PRINT "";" ";CHR$(2);"     ";
5900 LOCATE 4*J+2,50:PRINT "       ";
5910 LOCATE 4*J+3,50:PRINT "     ";CHR$(2);" ";:GOTO 5980
5920 '
5930 '   ONE
5940 '
5950 LOCATE 4*J+1,50:PRINT "";"       ";
5960 LOCATE 4*J+2,50:PRINT "   ";CHR$(2);"   ";
5970 LOCATE 4*J+3,50:PRINT "       ";:GOTO 5980
5980 REM   GET OUT
5990 COLOR 7,0
6000 LOCATE 1,1
6010 RETURN 
6020 REM  
6030 REM  COMPUTER OPTION
6040 REM  
6050 LOCATE 25,1
6060 PRINT "DO YOU WISH TO PLAY AGAINST ME?  Y/N  ";:GOSUB 2110
6070 Y$=INKEY$:IF Y$="" THEN 6070 ELSE BEEP
6080 IF Y$="N" OR Y$="n" THEN CC=0:RETURN
6090 IF Y$="Y" OR Y$="y" THEN CC=1:RETURN
6100 GOTO 6050
6110 REM  
6120 REM  CHECK FOR ACES-SIXES ANY POSITION
6130 REM  
6140 X= - 1
6150 FOR J= 0 TO 4
6160 IF S(0,J)= I THEN X= J
6170 NEXT J
6180 RETURN 
6190 REM  
6200 REM  TOTAL DICE VALUE
6210 REM  
6220 FOR J= 1 TO 5
6230 K(I,A)= K(I,A)+ C(J)
6240 NEXT J
6250 RETURN 
6260 REM  
6270 REM  MATRIX INFORMATION
6280 REM  
6290 REM  C(5)     CURRENT DICE
6300 REM  K(18,7)  SCOREBOARD
6310 REM           COLUMNS 1-13 BOARD NUMBER
6320 REM           COLUMN    14 BONUS UPPER
6330 REM           COLUMN    15 TOTAL UPPER
6340 REM           COLUMN    16 TOTAL LOWER
6350 REM           COLUMN    17 GRAND TOTAL
6360 REM           COLUMN    18 DONE/NOT DONE STATUS
6370 REM           ROW     1- 7 PLAYERS SCORE
6380 REM           ROW        N COMPUTERS SCORE (<7 PLAYERS)
6390 REM  
6400 REM  F(5)     DICE NUMBER TO ROLL AGAIN
6410 REM  A$(7)    PLAYERS NAMES
6420 REM  S(6,5)   COMPUTERS DICE LOGIC
6430 REM           COLUMN     0 DICE NUMBER BY QTY SEQUENCE
6440 REM           COLUMN     1 QTY/POSITION FOR ACES
6450 REM           COLUMN     2 QTY/POSITION FOR TWOS
6460 REM           COLUMN     3 QTY/POSITION FOR THREES
6470 REM           COLUMN     4 QTY/POSITION FOR FOURS
6480 REM           COLUMN     5 QTY/POSITION FOR FIVES
6490 REM           COLUMN     6 QTY/POSITION FOR SIXES
6500 REM           ROW        0 QUANTITY OF DICE
6510 REM           ROW     1- 5 POSITION OF DICE IN C(5)
6520 REM  
6530 REM  SAMPLE S(Y,X) FOR DICE OF 5,2,4,6,4
6540 REM  
6550 REM  Y/X   0  1  2  3  4  5
6560 REM  0     4  6  5  2          IN QTY/VALUE SEQUENCE
6570 REM  1                         NO DIE=1
6580 REM  2     1  2                1 TWO POSITION 2
6590 REM  3                         NO DIE=3
6600 REM  4     2  3  5             2 FOURS POSITIONS 3 AND 5
6610 REM  5     1  1                1 FIVE POSITION 1
6620 REM  6     1  4                1 SIX POSITION 4
6630 REM           +           +
6640 REM  +     +  ++++++++++++++++ SECTION FOR POSITION DATA
6650 REM  +     +------------------ COLUMN INDICATES QTY
6660 REM  +------------------------ INDEX EQUATES TO DIE VALUE
6670 REM  
6680 REM  M(13)    PRIORITY NUMBERS FOR MUST SCORE WHERE VALUE
6690 REM           REFERS TO PLAY BOARD NUMBER
6700 REM  
6710 REM  TO RUN INTERNAL CHECKS SECTION - ENTER A -1 FOR
6720 REM  PLAYING BOARD NUMBER OR QTY OF DICE TO ROLL
6730 REM  AGAIN - - DATA WILL NOT BE LOST AND SCREEN
6740 REM  WILL BE RESET WITH CURRENT DICE SHOWN - -
6750 REM  PLAYERS/COMPUTERS SCORE WILL NOT SHOW UNTIL
6760 REM  AFTER THEIR TURN
6770 REM  
6780 REM  COMPUTER PRIORIRIES
6790 RESTORE 6800
6800 DATA 11,9,12,8,1,2,3,4,5,6,10,7,13
6810 FOR Y= 1 TO 13:READ M(Y):NEXT :RETURN :RETURN 
6820 REM player's board
6830 CLS
6840 PRINT"             ????????????????????????
6850 PRINT"ACES........1?...?...?...?...?...?...?1"
6860 PRINT"TWOS........2?...?...?...?...?...?...?2"
6870 PRINT"THREES......3?...?...?...?...?...?...?3"
6880 PRINT"FOURS.......4?...?...?...?...?...?...?4"
6890 PRINT"FIVES.......5?...?...?...?...?...?...?5"
6900 PRINT"SIXES.......6?...?...?...?...?...?...?6"
6910 PRINT"             ????????????????????????"
6920 PRINT"TOTAL UPPER..?...?...?...?...?...?...?"
6930 PRINT"             ????????????????????????"
6940 PRINT"3 OF A KIND.7?...?...?...?...?...?...?7"
6950 PRINT"4 OF A KIND.8?...?...?...?...?...?...?8"
6960 PRINT"FULL HOUSE..9?...?...?...?...?...?...?9"
6970 PRINT"SM STRAIGHT.A?...?...?...?...?...?...?A"
6980 PRINT"LG STRAIGHT.B?...?...?...?...?...?...?B"
6990 PRINT"YATZEE......C?...?...?...?...?...?...?C"
7000 PRINT"CHANCE......D?...?...?...?...?...?...?D"
7010 PRINT"             ????????????????????????"
7020 PRINT"TOTAL LOWER..?...?...?...?...?...?...?"
7030 PRINT"TOP BONUS....?...?...?...?...?...?...?"
7040 PRINT"GRAND TOTAL..?...?...?...?...?...?...?"
7050 PRINT"             ????????????????????????"
7060 FOR N=1 TO 5:LOCATE N*4-2,46:PRINT N;:NEXT
7070 RETURN
7080 LOCATE 25,1:PRINT STRING$(70," ");:LOCATE 25,1:RETURN
7090 ' KB INPUT AND ESCAPE
7100 KB$="":WHILE KB$="":KB$=INKEY$:WEND
7110 IF KB$=CHR$(27) THEN 5100 ELSE RETURN
25,1:RETURN
7090 ' KB INPUT AND ESCAPE
7100 KB$="":WHILE KB$="":KB$=INKEY$:WEND
7110 IF KB$=CHR$(27) THEN 5100 ELSE RETURN