News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_SRS

Stunning Bowling Simulation converted from C64

Started by SRS, 22:22, 07 July 21

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

SRS

Now that I got your attention - her is a small "Bowling Simulator" converted from a C64 listing :)
5 MODE 1
10 DIM p(10),s(21)
20 FOR i=1 TO 21
30 s(i)=0
40 NEXT i
45 BORDER 0:INK 0,15:INK 1,26:z=RND(-ti)
50 FOR f=1 TO 10
60 b=1:s=0
70 GOSUB 300
80 GOSUB 330
90 GOSUB 450
91 PRINT:PRINT TAB(8);"frame";f;"ball";b;"score";sc
100 PRINT:PRINT TAB(11);"hit a key to bowl"
105 i$=INKEY$:IF i$<>"" THEN 105
110 i$=INKEY$:IF i$="" THEN 110
120 GOSUB 420
130 GOSUB 320
140 s=s+p
150 PRINT TAB(13);p;"pins down"
160 s(f*2-2+b)=p
170 IF f=10 THEN 220
180 IF b=2 OR (s=10 AND b=1) THEN 280
190 b=b+1:GOTO 90
200 REM bonus ball routine for 10th frame
210 REM if strike on first ball, two more balls
220 IF b=1 AND s=10 THEN PRINT"bowl two more!"
230 IF b=1 AND s=10 THEN s=0:GOSUB 300:GOSUB 320:GOTO 190
240 REM if strike or spare on second ball, one more ball
241 IF b=2 AND s(19)=10 AND s(20)<10 THEN PRINT"bowl one more!":s=0:GOTO 190
250 IF b=2 AND(s(19)=10 OR s(19)+s(20)=10) THEN PRINT"bowl one more!":s=0
260 IF b=2 AND(s(19)=10 OR s(19)+s(20)=10) THEN GOSUB 300:GOSUB 320:GOTO 190
270 IF b=1 THEN 190
280 NEXT f:GOSUB 450
290 PRINT:PRINT"score";sc
291 END
300 REM set up pins
310 FOR i=1 TO 10:p(i)=1:NEXT i:RETURN
320 REM display pins
330 PRINT:PRINT TAB(17);:FOR i=7 TO 10:IF p(i)=1 THEN PRINT"o ";:GOTO 350
340 PRINT"- ";
350 NEXT i:PRINT:PRINT TAB(18);:FOR i=4 TO 6:IF p(i)=1 THEN PRINT"o ";:GOTO 370
360 PRINT"- ";
370 NEXT i:PRINT:PRINT TAB(19);:FOR i=2 TO 3:IF p(i)=1 THEN PRINT"o ";:GOTO 390
380 PRINT"- ";
390 NEXT i:PRINT:PRINT TAB(20);:IF p(1)=1 THEN PRINT"o":GOTO 410
400 PRINT"-"
410 PRINT:RETURN
420 REM bowl ball
430 p=0:FOR i=1 TO 10:IF INT(RND(1)*6+1)<6 AND p(i)=1 THEN p(i)=0:p=p+1
440 NEXT i:RETURN
450 REM scoring calculator
460 sc=0:FOR i=1 TO 17 STEP 2:sc=sc+s(i)+s(i+1)
470 IF s(i)=10 THEN sc=sc+s(i+2)+s(i+3)+(s(i+4)*-(s(i+3)=0)):GOTO 490
480 IF s(i)+s(i+1)=10 THEN sc=sc+s(i+2)
490 NEXT i
500 sc=sc+s(19)+s(20)+s(21):RETURN




Bryce

Click bait has made it to the 8 bit scene?

Bryce.

Powered by SMFPacks Menu Editor Mod