1
0
mirror of https://github.com/rfivet/BCG101.git synced 2024-12-23 10:37:15 -05:00
BCG101/port/BINGO.BAS

192 lines
4.5 KiB
QBasic
Raw Normal View History

2024-06-09 22:43:10 -04:00
100 RANDOMIZE
120 PRINT"YOU ARE NOW GOING TO PLAY A COMPUTERIZED VERSION OF BINGO--"
180 LET F=1
190 DIM B(10,10),A(5)
200 DIM L(75)
210 FOR I=1 TO 5\READ A(I)\NEXT I
220 DATA 66, 73, 78, 71, 79
235 REM THIS SEQUENCE GENERATES THE CARD NUMBERS (LINES 240-430)
240 FOR K1=1 TO 75
250 LET L(K1)=0
260 NEXT K1
270 PRINT" "," HERE'S ";
280 IF F>1 THEN 310
290 PRINT"YOUR CARD"
300 GOTO 320
310 PRINT"MY CARD"
320 LET M=16
330 LET G=F+4
340 FOR Y=F TO G
350 FOR X=F TO G
360 LET R=INT(M*RND(1))
370 IF R<M-15 THEN 360
380 IF L(R)<>0 THEN 360
390 LET B(X,Y)=R
400 LET L(R)=1
410 NEXT X
420 LET M=M+15
430 NEXT Y
435 REM THIS SEQUENCE PRINTS THE CARD (LINES 440-670)
440 PRINT
450 PRINT"--B--","--I--","--N--","--G--","--O--"
460 FOR X=F TO G
470 PRINT
480 PRINT
490 PRINT
500 FOR Y=F TO G
510 IF B(X,Y)=B(F+2,F+2) THEN 540
520 PRINT B(X,Y),
530 GOTO 550
540 PRINT"FREE",
550 NEXT Y
560 NEXT X
570 PRINT
580 PRINT
590 PRINT
600 PRINT"--------------------------------------------------------------------"
610 PRINT" [TEAR OFF AFTER MACHINE AUTOMATICALLY ADVANCES PAPER]"
620 FOR K9=1 TO 9
630 PRINT
640 NEXT K9
650 IF F=6 THEN 680
660 LET F=6
670 GOTO 240
680 PRINT
690 PRINT"NOW WE'RE ALL SET TO PLAY THE GAME. USE A PENCIL TO MARK OFF"
700 PRINT"THE NUMBERS ON YOUR CARD AS THEY ARE CALLED."
710 PRINT" (PLEASE PLAY MY CARD AS WELL AS YOUR OWN)"
720 PRINT"***DON'T GET SMART. I'LL BE PLAYING BOTH YOUR CARD AND MINE"
730 PRINT " UP HERE IN BOSTON. (SO THERE--)"
740 PRINT
750 PRINT "ARE YOU READY";
760 INPUT R$
770 IF R$<>"NO" THEN 820
780 PRINT
790 PRINT"*********:HURRY UP:*********"
800 GOTO 740
810 REM
820 FOR K1=1 TO 75
830 LET L(K1)=0
840 NEXT K1
850 PRINT
860 LET B(3,3)=0
870 LET B(8,8)=0
875 REM THIS SEQUENCE GENERATES THE BINGO NUMBERS (LINES 880-1100)
880 LET U=INT(75*RND(1))+1
910 IF L(U)<>0 THEN 880
920 LET L(U)=1
930 PRINT
940 IF RND(1) > .5 THEN 970
950 PRINT"THE NUMBER COMES UP:",
960 GOTO 980
970 PRINT"THE NEXT ONE IS:",
980 PRINT CHR$(A(INT((U-1)/15)+1));U
1105 REM THIS IS THE "NUMBER ON CARD?" SEQUENCE (LINES 1110-1260)
1110 FOR Y=1 TO 10
1120 FOR X=1 TO 10
1130 IF B(X,Y)=U THEN 1250
1140 NEXT X
1150 NEXT Y
1160 LET F=1
1170 GOSUB 1270
1180 LET F=6
1190 GOSUB 1270
1200 IF V=0 THEN 1230
1210 IF W=1 THEN 1980
1220 GOTO 2010
1230 IF W=0 THEN 880
1240 GOTO 2020
1250 LET B(X,Y)=0
1260 GOTO 1140
1265 REM THIS IS THE BINGO DETERMINING SEQUENCE (LINES 1270-1950)
1266 '
1267 REM THIS IS THE VERTICAL CHECK FOR BINGO*** (LINES 1270-1430)
1270 LET G=F+4
1280 FOR Y=F TO G
1290 FOR X=F TO G
1300 IF B(X,Y)<>0 THEN 1430
1310 IF X<F+4 THEN 1420
1320 IF F=6 THEN 1370
1330 PRINT
1340 PRINT"YOU'VE GOT A B I N G O * * *"
1350 LET W=1
1360 RETURN
1370 PRINT
1380 PRINT"I'VE GOT A B I N G O * * * * *"
1390 LET V=1
1410 GO TO 1450
1420 NEXT X
1430 NEXT Y
1440 REM THIS IS THE HORIZONTAL CHECK FOR BINGO*** (LINES 1450-1610)
1450 LET G=F+4
1460 FOR X=F TO G
1470 FOR Y=F TO G
1480 IF B(X,Y)<>0 THEN 1610
1490 IF Y<F+4 THEN 1600
1500 IF F=6 THEN 1550
1510 PRINT
1520 PRINT"YOU'VE GOT A B I N G O * * *"
1530 LET W=1
1540 RETURN
1550 PRINT
1560 PRINT"I'VE GOT A B I N G O * * * * *"
1570 LET V=1
1590 GO TO 1620
1600 NEXT Y
1610 NEXT X
1615 REM THIS IS THE SLANT CHECK (M=-1) FOR BINGO*** (LINES 1620-1770)
1620 LET X=F
1630 LET Y=F
1640 IF B(X,Y)<>0 THEN 1770
1650 LET X=X+1
1660 LET Y=Y+1
1670 IF Y<F+5 THEN 1640
1680 IF Y=11 THEN 1740
1690 LET W=1
1700 PRINT
1710 PRINT"YOU'VE GOT A B I N G O * * *"
1730 RETURN
1740 PRINT"I'VE GOT A B I N G O * * * * *"
1750 LET V=1
1770 RETURN
1775 REM THIS IS THE SLANT CHECK (M=1) FOR BINGO*** (LINES 1780-1950)
1780 LET X=F+4
1790 LET Y=X
1800 IF B(X,Y)<>0 THEN 1950
1810 LET X=X-1
1820 LET Y=Y+1
1830 IF Y<F+5 THEN 1800
1840 IF Y=11 THEN 1900
1850 PRINT
1860 PRINT"YOU'VE GOT A B I N G O * * *"
1870 LET W=1
1890 RETURN
1900 PRINT
1910 PRINT"I'VE GOT A B I N G O * * * * *"
1920 LET V=1
1950 RETURN
1970 REM THIS THE TIE PRINTOUT SEQUENCE
1980 PRINT
1990 PRINT" *********** IT'S A TIE ***********"
1995 REM THIS IS THE "PLAY AGAIN?" SEQUENCE
2000 PRINT
2001 PRINT "DO YOU WANT TO PLAY AGAIN";
2002 INPUT E$
2003 PRINT
2004 IF E$="YES" THEN 180
2005 STOP
2009 REM THIS IS THE "I WIN" SEQUENCE
2010 PRINT
2011 FOR S=1 TO 6
2012 PRINT"I WIN. ";
2013 NEXT S
2014 PRINT
2015 PRINT
2016 GOTO 2000
2019 REM THIS IS THE "YOU WIN" SEQUENCE
2020 PRINT
2021 PRINT" YOU WIN..... YOU WIN....... YOU WIN......."
2022 GOTO 2000
2045 REM THIS IS THE "END" OF THE LIST OF PROGRAM ENTITLED "BINGO"
2046 END