10 REM KENO ACCORDING TO PAYOFFS OF
11 REM MGM GRAND CASINO LAS VEGAS JAN 1976
12 REM WRITTEN BY G.W.FLEMMING MEMBER SCCS
13 REM MODIFIED BY ED HALL
15 PRINT TAB(15);"$$$$$ K E N O $$$$$"
16 PRINT CHR$(7);CHR$(7);CHR$(7);TAB(15);"     $$$$$$$$$";CHR$(7)
17 PRINT CHR$(7);CHR$(7);CHR$(7);CHR$(7);CHR$(7)
18 INPUT "DO YOU WANT INSTRUCTIONS";D$
19 IF LEFT$(D$,1)="N" THEN 145
20 PRINT:PRINT "EACH PLAY WILL COST YOU $1. YOU MAY SELECT"
21 PRINT "FROM 1 TO 15 NUMBERS TO PLAY. WHEN ASKED FOR YOUR"
22 PRINT "NUMBERS, TYPE IN EACH NUMBER SEPARATED BY COMMAS."
23 PRINT "IF YOU ACCIDENTILY PLACE A COMMA AFTER YOUR LAST"
24 PRINT "NUMBER, THE COMPUTER WILL TELL YOU THAT THE EXTRA"
25 PRINT "NUMBER WAS IGNORED (IN THIS CASE, THE EXTRA WAS"
26 PRINT "A SPACE). IF YOU PUT IN MORE NUMBERS THAN ARE NEEDED,"
27 PRINT "ONLY THE FIRST REQUIRED ONES WILL BE USED. IF"
28 PRINT "YOU DON'T ENTER ENOUGH NUMBERS, THE COMPUTER WILL"
29 PRINT "RESPOND WITH '??'. ENTER THE REQUIRED EXTRA NUMBERS."
30 PRINT:PRINT "      THE COMPUTER WILL BE CHOOSING 20 NUMBERS"
31 PRINT "AT RANDOM FROM NUMBER 1 TO NUMBER 80."
32 PRINT:PRINT "TO QUIT, TYPE '0' WHEN ASKED HOW MANY NUMBERS YOU WANT."
33 PRINT:PRINT:PRINT "G O O D   L U C K ! ! ! ! !"
34 PRINT:PRINT
145 DIM A(20),H(80)
146 INPUT "IS THIS A CONTINUATION OF AN OLD GAME";A$
147 IF LEFT$(A$,1)="N" THEN 151
148 INPUT "HOW MANY DOLLARS WERE LEFT";S
150 GOTO 160
151 E=0
155 INPUT "HOW MUCH CASH DID YOU BRING";S
160 W=S
170 Q=0:PRINT
180 REM INPUT NUMBERS
190 INPUT "HOW MANY NUMBERS DO YOU WANT";T
191 IF T=0 THEN 2000
195 PRINT "YOUR NUMBERS: "
200 IF T=1 THEN INPUT A(1)
201 IF T=2 THEN INPUT A(1),A(2)
202 IF T=3 THEN INPUT A(1),A(2),A(3)
203 IF T=4 THEN INPUT A(1),A(2),A(3),A(4)
204 IF T=5 THEN INPUT A(1),A(2),A(3),A(4),A(5)
205 IF T=6 THEN INPUT A(1),A(2),A(3),A(4),A(5),A(6)
206 IF T=7 THEN INPUT A(1),A(2),A(3),A(4),A(5),A(6),A(7)
207 IF T=8 THEN INPUT A(1),A(2),A(3),A(4),A(5),A(6),A(7),A(8)
208 IF T=9 THEN INPUT "FIRST FIVE:";A(1),A(2),A(3),A(4),A(5)
209 IF T=9 THEN INPUT "LAST FOUR:";A(6),A(7),A(8),A(9)
210 IF T=10 THEN INPUT "FIRST FIVE:";A(1),A(2),A(3),A(4),A(5)
211 IF T=10 THEN INPUT "LAST FIVE:";A(6),A(7),A(8),A(9),A(10)
212 IF T=11 THEN INPUT "FIRST FIVE:";A(1),A(2),A(3),A(4),A(5)
213 IF T=11 THEN INPUT "LAST SIX:";A(6),A(7),A(8),A(9),A(10),A(11)
216 IF T=12 THEN INPUT "FIRST SIX:";A(1),A(2),A(3),A(4),A(5),A(6)
217 IF T=12 THEN INPUT "LAST SIX:";A(7),A(8),A(9),A(10),A(11),A(12)
218 IF T=13 THEN INPUT "FIRST FIVE:";A(1),A(2),A(3),A(4),A(5)
219 IF T=13 THEN INPUT "NEXT FIVE:";A(6),A(7),A(8),A(9),A(10)
220 IF T=13 THEN INPUT "LAST THREE:";A(11),A(12),A(13)
221 IF T=14 THEN INPUT "FIRST FIVE:";A(1),A(2),A(3),A(4),A(5)
222 IF T=14 THEN INPUT "NEXT FIVE:";A(6),A(7),A(8),A(9),A(10)
223 IF T=14 THEN INPUT "LAST FOUR:";A(11),A(12),A(13),A(14)
224 IF T=15 THEN INPUT "FIRST FIVE:";A(1),A(2),A(3),A(4),A(5)
225 IF T=15 THEN INPUT "NEXT FIVE:";A(6),A(7),A(8),A(9),A(10)
226 IF T=15 THEN INPUT "LAST FIVE:";A(11),A(12),A(13),A(14),A(15)
227 FOR R=1 TO T-1
230 FOR M=R+1 TO T
235 IF A(R)=A(M) THEN 255
236 IF A(R)>80 THEN 261
240 NEXT M
245 NEXT R
250 GOTO 299
255 PRINT "YOU HAVE DUPLICATED NUMBERS. TRY AGAIN."
260 GOTO 191
261 PRINT "YOU HAVE A NUMBER TOO LARGE. TRY AGAIN."
262 GOTO 191
299 N=T
300 FOR X=1 TO 20:REM SELECT 20 NUMBERS AT RANDOM
310 H(X)=INT(80*RND)+1
320 FOR Y=1 TO (X-1)
330 IF H(X)=H(X-Y) THEN 310
340 NEXT Y
350 NEXT X
399 REM DETERMINE HOW MANY WINNERS
400 FOR X=1 TO N
410 FOR Y=1 TO 20
420 IF A(X)=H(Y) THEN Q=Q+1
430 NEXT Y
440 NEXT X
499 REM DETERMINE PAYOFF
500 IF N<>1 THEN 550
510 IF Q=1 THEN W=W+3
550 IF N<>2 THEN 600
560 IF Q=2 THEN W=W+12
600 IF N<>3 THEN 650
610 IF Q=2 THEN W=W+1
620 IF Q=3 THEN W=W+43
650 IF N<>4 THEN 700
660 IF Q=2 THEN W=W+1
670 IF Q=3 THEN W=W+4
680 IF Q=4 THEN W=W+114
700 IF N<>5 THEN 750
710 IF Q=3 THEN W=W+1.5
715 IF Q=4 THEN W=W+21.5
720 IF Q=5 THEN W=W+485.5
750 IF N<>6 THEN 800
760 IF Q=3 THEN W=W+1
765 IF Q=4 THEN W=W+4.5
770 IF Q=5 THEN W=W+85.5
775 IF Q=6 THEN W=W+1571.5
800 IF N<>7 THEN 850
810 IF Q=3 THEN W=W+.5
815 IF Q=4 THEN W=W+1.5
820 IF Q=5 THEN W=W+21.5
825 IF Q=6 THEN W=W+328.5
830 IF Q=7 THEN W=W+5000
850 IF N<>8 THEN 900
855 IF Q=5 THEN W=W+8.5
860 IF Q=6 THEN W=W+85.5
865 IF Q=7 THEN W=W+1643
870 IF Q=8 THEN W=W+17857
900 IF N<>9 THEN 950
905 IF Q=4 THEN W=W+.5
910 IF Q=5 THEN W=W+3
920 IF Q=6 THEN W=W+43
925 IF Q=7 THEN W=W+285.5
930 IF Q=8 THEN W=W+4000
935 IF Q=9 THEN W=W+17857
950 IF N<>10 THEN 1000
955 IF Q=5 THEN W=W+2
956 IF Q=6 THEN W=W+20
957 IF Q=7 THEN W=W+140
958 IF Q=8 THEN W=W+1000
959 IF Q=9 THEN W=W+3800
960 IF Q=10 THEN W=W+17857
1000 IF N<>11 THEN 1050
1001 IF Q=5 THEN W=W+1
1002 IF Q=6 THEN W=W+8.5
1003 IF Q=7 THEN W=W+71.5
1004 IF Q=8 THEN W=W+357
1005 IF Q=9 THEN W=W+1714
1006 IF Q=10 THEN W=W+10714
1007 IF Q=11 THEN W=W+17857
1050 IF N<>12 THEN 1100
1055 IF Q=5 THEN W=W+1
1056 IF Q=6 THEN W=W+4
1057 IF Q=7 THEN W=W+28.5
1058 IF Q=8 THEN W=W+214
1059 IF Q=9 THEN W=W+571.5
1060 IF Q=10 THEN W=W+1428.5
1061 IF Q=11 THEN W=W+7143
1062 IF Q=12 THEN W=W+25000
1100 IF N<>13 THEN 1150
1101 IF Q=6 THEN W=W+1.5
1102 IF Q=7 THEN W=W+17
1103 IF Q=8 THEN W=W+71.5
1104 IF Q=9 THEN W=W+678.5
1105 IF Q=10 THEN W=W+3571.5
1106 IF Q=11 THEN W=W+6428.5
1107 IF Q=12 THEN W=W+14285.7
1108 IF Q=13 THEN W=W+25000
1150 IF N<>14 THEN 1200
1160 IF Q=6 THEN W=W+3
1161 IF Q=7 THEN W=W+8
1162 IF Q=8 THEN W=W+31.5
1163 IF Q=9 THEN W=W+250
1164 IF Q=10 THEN W=W+714
1165 IF Q=11 THEN W=W+2857
1166 IF Q=12 THEN W=W+10714
1167 IF Q=13 THEN W=W+21428.5
1168 IF Q=14 THEN W=W+25000
1200 IF N<>15 THEN 1900
1201 IF Q=6 THEN W=W+1.5
1202 IF Q=7 THEN W=W+7
1203 IF Q=8 THEN W=W+21.5
1204 IF Q=9 THEN W=W+107
1205 IF Q=10 THEN W=W+285.5
1206 IF Q=11 THEN W=W+2143
1207 IF Q=12 THEN W=W+7143
1208 IF Q=13 THEN W=W+21428.5
1209 IF Q=14 THEN W=W+25000
1210 IF Q=15 THEN W=W+25000
1899 REM PRINT GAME RESULTS
1900 PRINT "MY NUMBERS WERE: "
1905 PRINT
1910 FOR X=1 TO 10
1920 PRINT H(X);
1930 NEXT X
1935 PRINT
1940 FOR X=11 TO 20
1950 PRINT H(X);
1960 NEXT X
1965 PRINT: PRINT: W=W-1: REM SUBTRACT BET
1966 E=E+1
1967 IF W<1 AND W>0 THEN PRINT "YOU HAD ";Q;"RIGHT, BUT NOW YOU"
1968 IF W<1 AND W>0 THEN PRINT "DON'T HAVE ENOUGH TO BET."
1969 IF W<1 AND W>0 THEN GOTO 2000
1970 IF W=0 THEN PRINT "YOU HAD";Q;"RIGHT, BUT NOW YOU'RE BROKE."
1971 IF W=0 THEN 2000
1972 PRINT "YOU HAD ";Q;"RIGHT. YOU NOW HAVE ";W;"DOLLARS LEFT."
1980 GOTO 170
2000 PRINT "COME BACK AGAIN. BRING MORE MONEY!!!"
2010 PRINT "TOTAL TURNS ";E
2020 PRINT "TOTAL MONEY LEFT ";W
2500 END
19000 PRINT "MY NUMBERS WERE: "
