home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nibble Magazine
/
nib14.dsk
/
BADMINTON.bas
< prev
next >
Wrap
BASIC Source File
|
2023-02-26
|
10KB
|
205 lines
1 REM **********************
2 REM * APPLE BADMINTON *
3 REM * BY STEVEN WONG *
4 REM * COPYRIGHT (C) 1983 *
5 REM * BY MICROSPARC, INC *
6 REM * LINCOLN, MA. 01773 *
7 REM **********************
10 LOMEM: 17200: GOSUB 7000: GOTO 5000
20 IF T1 < >0 THEN & T50,1
30 IF PEEK(P0) >IM THEN F1 = 1
40 IF PEEK(P1) >IM THEN F2 = 1
50 RETURN
100 CC = 6: IF CY >0 THEN CC = 10
110 XB = XB +M *CX:YB = YB +CC *CY: GOSUB 20
120 XB = INT(XB):YB = INT(YB): IF HF = 1 THEN 160
130 IF XB <15 AND YB <165 THEN WF = 1:BF = 2: GOTO 3000
140 GOSUB 20: IF XB <0 OR YB >181 THEN WF = 2:BF = 1: GOTO 3000
150 GOTO 180
160 IF XB >263 AND YB <165 THEN WF = 2:BF = 3: GOTO 3000
170 GOSUB 20: IF XB >279 OR YB >181 THEN WF = 1:BF = 4: GOTO 3000
180 IF O1 THEN IF XB >139 AND HF = 1 THEN CY = ABS(CY):M = RND(1) *6 +4:O1 = 0: IF YB <135 THEN YB = YB +( RND(1) *5 +15)
190 GOSUB 20: IF O2 THEN IF XB <139 AND HF = 2 THEN CY = ABS(CY):M = RND(1) *6 +4:O2 = 0: IF YB <135 THEN YB = YB +( RND(1) *5 +15)
200 IF YB <54 THEN YB = 50: HCOLOR= 0: DRAW 7 AT B1,B2:XB = 139: GOTO 600
210 HCOLOR= 3: DRAW 7 AT XB,YB: GOSUB 20
220 HCOLOR= 0: DRAW 7 AT B1,B2:B1 = XB:B2 = YB
600 T1 = 0:X = PDL(0): IF X >177 THEN XL = XL +8:T1 = 1: IF XL = >120 THEN XL = 120:T1 = 0
610 GOSUB 20: IF X <77 THEN XL = XL -8:T1 = -1: IF XL < = 8 THEN XL = 8:T1 = 0
620 IF XL = X1 THEN 670
630 X = X1 +(4 *T1): HCOLOR= 0: DRAW 1 AT X1,YL
640 HCOLOR= 3: DRAW 2 AT X,YL: GOSUB 20
650 HCOLOR= 0: DRAW 2 AT X,YL
660 HCOLOR= 3: DRAW 1 AT XL,YL:X1 = XL
670 IF XB >139 THEN 800
680 GOSUB 20: IF F1 THEN GOSUB 1000
800 T1 = 0:X = PDL(1): IF X >167 THEN XR = XR +8:T1 = 1: IF XR = >270 THEN XR = 270:T1 = 0
810 GOSUB 20: IF X <87 THEN XR = XR -8:T1 = -1: IF XR < = 158 THEN XR = 158:T1 = 0
820 IF XR = X2 THEN 870
830 X = X2 +(4 *T1): HCOLOR= 0: DRAW 4 AT X2,YL
840 HCOLOR= 3: DRAW 5 AT X,YL: GOSUB 20
850 HCOLOR= 0: DRAW 5 AT X,YL
860 HCOLOR= 3: DRAW 4 AT XR,YL:X2 = XR
870 IF XB <139 THEN 100
880 GOSUB 20: IF F2 THEN GOSUB 1500
890 GOTO 100
1000 F1 = 0:X = 0: HCOLOR= 0: DRAW 1 AT XL,YL
1010 HCOLOR= 3: DRAW 3 AT XL,YL: FOR L = 70 TO 40 STEP -10: & TL,3: NEXT
1020 IF YB <100 THEN 1050
1030 XT = XL +10:YT = YL
1040 IF XB -XT <15 AND XB -XT > -5 THEN IF (YT -YB) <10 THEN HF = 1:X = 1
1050 HCOLOR= 0: DRAW 3 AT XL,YL
1060 HCOLOR= 3: DRAW 1 AT XL,YL
1070 IF X THEN 2030
1080 RETURN
1500 F2 = 0:X = 0: HCOLOR= 0: DRAW 4 AT XR,YR
1510 HCOLOR= 3: DRAW 6 AT XR,YR: FOR L = 70 TO 40 STEP -10: & TL,3: NEXT
1520 IF YB <100 THEN 1550
1530 UT = XR -10:VT = YR
1540 IF UT -XB <15 AND UT -XB > -5 THEN IF ABS(VT -YB) <10 THEN HF = 2:X = 1
1550 HCOLOR= 0: DRAW 6 AT XR,YR
1560 HCOLOR= 3: DRAW 4 AT XR,YR
1570 IF X THEN 2000
1580 RETURN
2000 CY = ABS(CY) * -1:CX = ABS(CX) * -1:O2 = 1
2010 IF XB <191 THEN GOSUB 2090
2020 GOTO 2050
2030 CY = ABS(CY) * -1:CX = ABS(CX):O1 = 1
2040 IF XB >87 THEN GOSUB 2090
2050 M = RND(1) *6 +6
2060 YB = RND(1) *40 +100
2070 & T RND(1) *190 +50,10
2080 RETURN
2090 IF RND(1) <.5 THEN YB = RND(1) *100 +40:M = 30: RETURN
2100 YB = RND(1) *120 +60:M = 20: RETURN
3000 ON BF GOTO 3010,3040,3050,3060
3010 IF XB < = 8 AND YB >181 THEN A1 = 1:A2 = 182: GOTO 3090
3020 IF XB = >8 AND YB >181 THEN A1 = XB:A2 = 182: GOTO 3090
3040 A1 = 1:A2 = YB: GOTO 3090
3050 A1 = 277:A2 = YB: GOTO 3090
3060 IF XB = >270 AND YB >181 THEN A1 = 277:A2 = 182: GOTO 3090
3070 IF XB < = 270 AND YB >181 THEN A1 = XB:A2 = 182: GOTO 3090
3080 A1 = 277:A2 = YB
3090 HCOLOR= 0: DRAW 7 AT B1,B2
3100 HCOLOR= 3: DRAW 7 AT A1,A2
3110 FOR I = 1 TO 50: & T100,2: NEXT
3120 FOR I = 1 TO 500: NEXT I
3130 HCOLOR= 0: DRAW 7 AT A1,A2
3140 DRAW 1 AT XL,YL: DRAW 4 AT XR,YL
3150 HCOLOR= 4:PP = 60: GOSUB 5070:PP = 216: GOSUB 5070
3160 IF SF = 1 AND WF = 1 THEN S1 = S1 +1:XF = 1: GOTO 4000
3170 IF SF = 1 AND WF = 2 THEN SF = 2: GOTO 4000
3180 IF SF = 2 AND WF = 2 THEN S2 = S2 +1:XF = 1: GOTO 4000
3190 IF SF = 2 AND WF = 1 THEN SF = 1
4000 IF NOT XF THEN 5000
4010 I = 37:J = S1: IF WF = 2 THEN I = 243:J = S2
4020 X = 41: IF J < >10 THEN 4050
4030 HCOLOR= 4: DRAW 8 AT I -10,X: DRAW 17 AT I,X
4040 HCOLOR= 5: DRAW 9 AT I -10,X:J = 8: GOTO 4070
4050 IF J = >10 THEN J = J -10
4060 J = J +8: HCOLOR= 4: DRAW J -1 AT I,X
4070 HCOLOR= 5: DRAW J AT I,X: & T40,5:WF = 0:XF = 0
4080 IF S1 = 15 OR S2 = 15 THEN 8500
5000 GOSUB 8000: FOR PA = 1 TO 500: NEXT PA
5010 & T200,10: & T50,20: IF SF = 2 THEN 5030
5020 XB = 10:CX = 1:CY = -1:HF = 1:PP = 60:P4 = 1:P5 = 8:F1 = 1:O1 = 1: GOTO 5040
5030 XB = 268:CX = -1:CY = -1:HF = 2:PP = 216:P4 = 4:P5 = 270:F2 = 1:O2 = 1
5040 M = RND(1) *6 +4:B1 = 140:B2 = 80
5050 YB = RND(1) *4 +168
5060 WK = -16288 +SF:F3 = 0: GOTO 5100
5070 DRAW 26 AT PP,38: RETURN
5080 IF NOT F3 THEN RETURN
5090 POP : GOTO 100
5100 FOR J = 4 TO 5: HCOLOR= J: GOSUB 5070
5110 K = 0: IF J = 5 THEN K = 3
5120 HCOLOR= K
5130 DRAW P4 AT P5,171: FOR I = 1 TO 40 +20 *J
5140 IF PEEK(WK) >IM THEN F3 = 1
5150 NEXT : NEXT : GOSUB 5080
5160 & T50,4: GOTO 5100
7000 TEXT : HOME : FOR J = 6 TO 12 STEP 6: VTAB J: HTAB 7: FOR I = 1 TO 28: PRINT "*";: NEXT I,J
7010 FOR I = 7 TO 11: VTAB I: HTAB 6: PRINT "*";: HTAB 35: PRINT "*": NEXT
7020 VTAB 8: HTAB 10: PRINT " APPLE BADMINTON ": VTAB 10: HTAB 14: PRINT "BY STEVEN WONG": VTAB 22: PRINT "** COPYRIGHT 1983 BY MICROSPARC, INC. **"
7030 KB = -16384:KR = -16368:P0 = -16287:P1 = -16286:IM = 127
7040 R0 = 255:R1 = 255:P = 140:PL = 164
7100 IF PEEK(768) = 201 AND PEEK(803) = 170 THEN 7160
7110 MU$ = "201,084,208,015,032,177,000,032,248,230,138,072,032,183,000,201,044,240,003,076,201,222,032,177,000,032,248,230,104,134,003,134,001,133,000"
7120 FOR I = 1 TO 35: POKE I +767, VAL( MID$ (MU$,I *4 -3,I *4 -1)): NEXT
7130 MU$ = "170,160,001,132,002,173,048,192,136,208,004,198,001,240,007,202,208,246,166,000,208,239,165,003,133,001,198,002,208,241,096"
7140 FOR I = 1 TO 33: POKE I +802, VAL( MID$ (MU$,I *4 -3,I *4 -1)): NEXT
7150 POKE 1013,76: POKE 1014,0: POKE 1015,3
7160 IF PEEK(233) = 64 AND PEEK(16384) = 26 THEN 7180
7170 PRINT CHR$(4)"BLOAD BADSHAPES": POKE 232,0: POKE 233,64
7180 VTAB 20: HTAB 9: PRINT "> HIT ANY KEY TO BEGIN <"
7190 IF PEEK(KB) < = IM THEN 7190
7200 POKE KR,0: HOME
7210 VTAB 7: CALL -958: PRINT "FIRST PLAYER NAME? ";: INPUT "";N1$: IF N1$ = "" THEN 7210
7220 N1$ = LEFT$(N1$,6)
7230 VTAB 10: CALL -958: PRINT "SECOND PLAYER NAME? ";: INPUT "";N2$: IF N2$ = "" THEN 7230
7240 N2$ = LEFT$(N2$,6): IF N1$ = N2$ THEN & T50,50: GOTO 7230
7250 VTAB 13: CALL -958: PRINT "WHAT YEAR IS THIS (XXXX)? ";: INPUT "";YR$: IF YR$ = "" THEN 7250
7260 X = VAL( LEFT$(YR$,4))
7270 IF X <1982 OR X >9999 THEN X = 1983
7280 YR$ = STR$(X):HF$ = N2$:TF = 2
7290 IF RND(1) <.5 THEN HF$ = N1$:TF = 1
7300 VTAB 16: PRINT HF$" (H)EADS OR (T)AILS? ";
7310 GET AN$: IF AN$ < >"H" AND AN$ < >"T" THEN 7310
7320 PRINT AN$: IF AN$ = "H" THEN RF = 1
7330 IF AN$ = "T" THEN RF = 2
7340 VTAB 16: HTAB 32: PRINT CHR$(91)" ]";
7350 FOR I = 1 TO 30:RN = INT( RND(1) *2 +1)
7360 VTAB 16: HTAB 33
7370 IF RN = 1 THEN PRINT "HEADS!";
7380 IF RN = 2 THEN PRINT "TAILS!";
7390 & T2 *I,2: NEXT
7400 IF TF = 1 AND RF < >RN THEN SF = 2
7410 IF TF = 1 AND RF = RN THEN SF = 1
7420 IF TF = 2 AND RF < >RN THEN SF = 1
7430 IF TF = 2 AND RF = RN THEN SF = 2
7440 FOR PA = 10 TO 200: & TPA,2: & T255 -PA,3: NEXT : FOR PA = 1 TO 250: NEXT PA
7500 HOME : VTAB 4
7510 PRINT "WELCOME TO THE FINALS OF THE "YR$
7520 FLASH : PRINT "NIBBLETON TOURNAMENT!": NORMAL : PRINT
7530 PRINT : PRINT N1$", YOU WILL TAKE THE COURT TO THE": PRINT "LEFT AND USE PADDLE 0."
7540 PRINT : PRINT N2$", YOU WILL TAKE THE RIGHT COURT": PRINT "AND USE PADDLE 1."
7550 N$ = N1$: IF SF = 2 THEN N$ = N2$
7560 PRINT : PRINT N$" WILL SERVE FIRST. . ."
7570 PRINT : PRINT "GOOD LUCK AND DON'T FORGET TO KEEP YOUR EYES ON THE BIRDIE!"
7580 VTAB 20: PRINT "PRESS A PADDLE BUTTON TO BEGIN. . . . ."
7590 I = RND( PEEK(78) + PEEK(79) *I):I = RND( -I)
7600 IF PEEK(P0) < = IM AND PEEK(P1) < = IM THEN 7590
7630 HOME : HGR : POKE -16302,0: SCALE= 1: ROT= 0
7640 GOSUB 9000: RETURN
8000 SCALE= 1: ROT= 0: HCOLOR= 1: FOR I = 185 TO 191: HPLOT 1,I TO 278,I: NEXT
8010 HCOLOR= 3: FOR I = 138 TO 141: HPLOT I,160 TO I,188: NEXT
8020 YL = 171:YR = YL:X1 = 8:XL = X1:X2 = 270:XR = X2
8030 DRAW 1 AT X1,YL: DRAW 4 AT X2,YR
8050 IF MF = 0 THEN & T96,40: & T72,40: & T57,40: & T48,80: & T57,40: & T48,160:MF = 1
8060 RETURN
8500 POKE -16301,0: HOME : IF S2 = 15 THEN 8520
8510 WN$ = N1$:LO$ = N2$:S5 = S1:S6 = S2: GOTO 8530
8520 WN$ = N2$:LO$ = N1$:S5 = S2:S6 = S1
8530 FOR I = 10 TO 100 STEP 5: & T110 -I,3: & T50,3: & T100 +I,3: NEXT
8540 VTAB 21: PRINT "THE WINNER OF THE TOURNAMENT IS "WN$"!"
8550 PRINT "BY THE SCORE OF "S5" TO "S6"!"
8560 VTAB 24: HTAB 1: PRINT "DO YOU GUYS WANT TO PLAY AGAIN? ";
8570 GET AN$: IF AN$ = "N" THEN 9999
8580 IF AN$ < >"Y" THEN 8560
8590 RUN
9000 HCOLOR= 2: FOR I = 2 TO 48: HPLOT 10,I TO 270,I: NEXT
9010 HCOLOR= 0: FOR I = 7 TO 23: HPLOT 100,I TO 178,I: NEXT
9020 FOR I = 28 TO 44: HPLOT 19,I TO 70,I: HPLOT 208,I TO 259,I
9030 HPLOT 90,I TO 188,I: NEXT
9040 HCOLOR= 5: DRAW 8 AT 27,41: DRAW 8 AT 37,41
9050 DRAW 8 AT 233,41: DRAW 8 AT 243,41
9060 FOR I = 1 TO 4: DRAW VAL( MID$ (YR$,I,1)) +8 AT 111 +I *10,20: NEXT
9070 HCOLOR= 7: DRAW 25 AT 59,38: DRAW 25 AT 215,38
9080 HCOLOR= 3
9090 FOR I = 1 TO 9: READ J,K
9100 DRAW J AT K,42: NEXT
9110 DATA 18,102,19,112,20,117,20,127
9120 DATA 21,137,22,143,23,152,24,160,18,169
9130 HCOLOR= 6: HPLOT 271,1 TO 9,1 TO 9,49 TO 271,49 TO 271,1
9140 HPLOT 271,0 TO 8,0 TO 8,50 TO 271,50
9150 HPLOT 7,0 TO 7,50
9160 RETURN
9999 TEXT : HOME : END