10 DIM N(20),M(20),A(8)
20 REM *** KENO WRITTEN BY VINCENT FAZIO, EDISON TECH HS, ROCHESTER, NY
30 REM *** CONVERTED TO BASIC-PLUS BY DAVE AHL, DIGITAL
40 PRINT  \ PRINT 
50 PRINT "KENO IS PLAYED IN MANY CASINOS IN LAS VEGAS."
60 PRINT 
70 PRINT "THE PLAYER CHOOSES 8 DIFFERENT NUMBERS FROM 1 TO 80,"
80 PRINT "INCLUSIVE, AND BETS $1.20. THE COMPUTER WILL SELECT"
90 PRINT "20 NUMBERS AT RANDOM AND WILL ELIMINATE DUPLICATES WHICH"
100 PRINT "MAY OCCUR. ANOTHER NUMBER WILL BE INSERTED IN ITS PLACE"
110 PRINT "SO THAT THE COMPUTER WILL OUTPUT 20 DIFFERENT NUMBERS."
120 PRINT  \ PRINT 
130 PRINT  \ PRINT "HERE WE GO!!!"
140 PRINT "THE COMPUTER WILL OUTPUT A ? MARK. TYPE A NUMBER FROM "
150 PRINT "1 TO 80, INCLUSIVE, AND PRESS THE RETURN KEY. REPEAT THIS"
160 PRINT "PROCESS UNTIL THE ? MARK IS NO LONGER SHOWN."
170 FOR I=1 TO 8
180 INPUT A(I)
190 IF A(I)>80 GO TO 230
200 IF A(I)=0 GO TO 230
210 IF A(I)<0 GO TO 230
220 GO TO 240
230 PRINT "TYPE A NUMBER FROM 1 TO 80, INCLUSIVE, PLEASE." \ GO TO 180
240 NEXT I
250 C=0 \ FOR K=1 TO 7
260 FOR J=K TO 7
270 X=A(K) \ Y=A(J+1) \ IF X=Y GO TO 290
280 GO TO 390
290 C=C+1
300 PRINT "A DUPLICATE NUMBER HAS BEEN DETECTED IN YOUR INPUT."
310 PRINT "TYPE ANOTHER NUMBER, PLEASE." \ INPUT Y
320 IF Y=0 GO TO 370
330 IF Y>80 GO TO 370
340 IF Y<0 GO TO 370
350 A(J+1)=Y
360 GO TO 280
370 PRINT "TYPE A NUMBER FROM 1 TO 80, INCLUSIVE, PLEASE."
380 GO TO 310
390 NEXT J
400 NEXT K \ PRINT  \ PRINT 
410 IF C=0 GO TO 430
420 GO TO 250
430 PRINT "THE COMPUTER WILL SELECT 20 NUMBERS AT RANDOM. THE BELL TONE"
440 PRINT "INDICATES IT IS IN THE PROCESS OF SELECTING THE NUMBERS."
450 RANDOMIZE
460 FOR L=1 TO 20
470 N(L)=INT(80*RND(0)+1)
480 M(L)=N(L)
490 NEXT L
500 L=20
510 FOR K=1 TO 20
520 FOR J=K TO L-1
530 X=M(K)
540 Y=M(J+1)
550 IF X<>Y GO TO 600
560 RANDOMIZE
570 M(J+1)=INT(80*RND(0)+1)
580 Y=M(J+1)
590 GO TO 550
600 PRINT CHR$(7);
610 NEXT J
620 NEXT K
630 PRINT  \ PRINT 
640 PRINT "YOUR NUMBERS ARE:"
650 FOR I=1 TO 8
660 PRINT A(I);
670 NEXT I \ PRINT  \ PRINT  \ PRINT 
680 PRINT "THE COMPUTER HAS SELECTED THE FOLLOWING NUMBERS:"
690 FOR L=1 TO 20
700 PRINT M(L);
710 NEXT L \ PRINT  \ PRINT 
720 PRINT "THE PROGRAM WILL COMPARE YOUR NUMBERS WITH THE "
730 PRINT "NUMBERS THE COMPUTER HAS SELECTED."
740 PRINT  \ PRINT 
750 PRINT "LISTEN FOR THE BELL TONE---EACH RING INDICATES ANOTHER"
760 PRINT "CORRECT GUESS BY YOU."
770 PRINT "YOU HAVE GUESSED THE FOLLOWING NUMBERS:"
780 G=0
790 FOR I=1 TO 8
800 FOR J=1 TO 20
810 X=A(I)
820 Y=M(J)
830 IF X=Y GO TO 860
840 NEXT J
850 GO TO 890
860 PRINT CHR$(7);
870 PRINT A(I);
880 G=G+1
890 NEXT I \ PRINT 
900 IF G<5 GO TO 950
910 IF G=5 GO TO 1050
920 IF G=6 GO TO 1070
930 IF G=7 GO TO 1090
940 IF G=8 GO TO 1110
950 PRINT "YOU CAUGHT";G;"NUMBER(S) OUT OF 8--"
960 PRINT "NOT ENOUGH CORRECT GUESSES--'SO SOLLY', NO PAYOFF."
970 PRINT  \ PRINT 
980 C=0
990 PRINT "WANT TO PLAY KENO AGAIN (YES OR NO)"; \ INPUT X$
1000 IF X$="YES" GO TO 130
1010 IF X$="NO" GO TO 1140
1020 C=C+1
1030 IF C=3 GO TO 1140
1040 PRINT "PLEASE TYPE 'YES' OR 'NO'" \ GO TO 990
1050 PRINT "YOU CAUGHT";G;"NUMBERS OUT OF 8--YOU WIN $10.00"
1060 GO TO 970
1070 PRINT "YOU CAUGHT";G;"NUMBERS OUT OF 8--YOU WIN $100.00"
1080 GO TO 970
1090 PRINT "YOU CAUGHT";G;"NUMBERS OUT OF 8--YOU WIN $2,200.00"
1100 GO TO 970
1110 PRINT "YOU CAUGHT";G;"NUMBERS OUT OF 8--YOU WIN $25,000.00"
1120 PRINT "8 OUT OF 8 DOES NOT OCCUR TOO OFTEN, LUCKY."
1130 GO TO 970
1140 PRINT "THAT'S ALL FOR NOW.  PLAY KENO AGAIN !  BE SEEING YOU !"
1150 END
