Q$ | User input string |
N%(0) to N%(6) | The seven secret digits |
X% | General counter |
Z% | Starting allowance in seconds |
X$ | Graphics line start |
E$ | Graphics line end |
G% | Player's input digit |
T% | Time left in seconds |
C% | Colour of double-height print |
10 REM - Time bomb 20 CLS:PROCDBL(5,5,129,"TIME-BOMB") 30 INPUT''"Do you want instructions",Q$ 40 IF Q$="Y" PROCINSTR 50 DIM N%(6),S%(6):VDU23;8202;0;0;0; 60 70 REM - Set-up 80 FOR X%=0 TO 6:N%(X%)=RND(10)-1:S%(X%)=0:NEXT 90 Z%=RND(10)+10:X$=CHR$129+CHR$157+CHR$135:E$=CHR$156 100 110 REM - Draw box of explosives 120 CLS:PRINTTAB(5,3);:RESTORE:FOR X%=1 TO 23:READ Y% 122 PRINTCHR$(Y%);:NEXT 125 DATA149,248,248,53,232,244,245,126,52,124,126,234 126 DATA32,244,224,52,53,248,232,53,244,234,52 130 PRINTTAB(3,4);X$;TAB(50);E$ 140 PRINTTAB(3,5);X$;" E X P L O S I V E S ";E$ 150 PRINTTAB(0,6);X$;TAB(33);E$ 160 PRINTTAB(3,7);X$;TAB(27);E$ 180 PROCUPDATE 190 PRINTTAB(3)X$;" ";E$;STRING$(15," ");X$;" ";E$ 200 PRINTTAB(3);X$;TAB(30);E$ 210 TIME=0:X%=0 220 230 REM - Game loop 240 250 REPEAT:G%=INKEY(0)-48 260 IF G%<0GOTO300 270 IF G%=N%(X%) VDU7:S%(X%)=G%:X%=X%+1:IF X%=7 GOTO400 280 IF G%<N%(X%) SOUND1,-15,50,1 290 IF G%>N%(X%) SOUND 1,-15,500,1 300 T%=Z%-TIME/100:PROCUPDATE 310 UNTIL TIME>=Z%*100 320 330 REM - Big bang 340 CLS:PROCCRASH:*FX15,1 350 PROCDBL(5,3,129,"OH DEAR!") 360 PRINT''"That's another fine pair of eyebrows" 370 PRINT"you've lost, Stanley!":GOTO430 380 390 REM - Win 400 PROCDBL(2,16,130,"C O N G R A T U L A T I O N S !") 410 PROCWARBLE:PRINT'"YOU DID IT AND SAVED THE OLD SCHOOL!" 420 PRINT"The Head kisses you on both cheeks!" 430 *FX15,0 435 INPUT"PLAY AGAIN (Y-N)",Q$:IF Q$="Y" GOTO80 ELSE END 440 450 DEFPROCDBL(X%,Y%,C%,X$) 460 PRINTTAB(X%,Y%)CHR$141;CHR$C%;X$ 470 PRINTTAB(X%,Y%+1)CHR$141;CHR$C%;X$:ENDPROC 480 490 DEFPROCUPDATE 500 PRINTTAB(3,8)X$;" TIME:";T%;X$;;TAB(27);E$ 510 PRINTTAB(3)X$;TAB(30);E$ 520 PRINTTAB(3)X$;" ";E$;STRING$(15," ");X$;" ";E$ 530 PRINTTAB(3);X$;" ";E$;" "; 540 FOR Q%=0TO6:PRINT;S%(Q%);" ";:NEXT:PRINT;X$;" ";E$ 550 ENDPROC 560 570 DEFPROCINSTR 580 CLS:PRINT''"The dastardly Sir Simon Ffoul-Enuff has" 590 PRINT"planted a bomb in the refreshment tent" 600 PRINT"at your school fete! It is bolted to" 610 PRINT"the tea urn and so cannot be moved. The" 620 PRINT"only way for you to save civilisation" 630 PRINT"as we know it, is to render" 640 PRINT"the bomb harmless."' 650 PRINT"There are seven numbers to find. If" 660 PRINT"your guess is low, the mechanism gives" 670 PRINT"a low note, while if it is high, then" 680 PRINT"a high note is emitted." 690 PRINT'"A beep tells you that you have found" 700 PRINT"that number & can move on to the next." 710 PRINT'"You have only a few seconds."'' 720 PRINT"Good luck!":INPUT'" Press RETURN...";Q$ 730 ENDPROC 740 750 DEFPROCWARBLE 760 FORS%=1TO20:SOUND1,-12,30,1 770 SOUND1,-12,100,1:NEXT:ENDPROC 780 790 DEFPROCCRASH 800 FOR Q%=-160TO0:SOUND0,Q%/10,6,1:NEXT:ENDPROC