8-Bit Software Online Conversion
Cyclo computer - Listing
10DEFFNS="Cyclo"
20ONERROR @%=&90A:IF ERR<>17:MODE0:RE
PORT:PRINTERL:END
30MODE7
40VDU23;8202;0;0;0;
50A%=257:REM Revolutions Per Mile
60D%=200
70R%=1
80TIME=0
90PRINT"
ardson"''" For 8-Bit Software"
100PRINTTAB(14,7)" Press a key"
110REPEATUNTILGET
120PRINTTAB(11,6);"
140PRINT'TAB(15);"
150VDU31,0,9,152,10,152
160PRINTTAB(5,12);" Time elapsed :
"
170PRINTTAB(5,13);" Miles covered :
"
180PRINTTAB(5,14);" Average speed :
"
190PRINTTAB(10,18);" SPACE to slow dow
n"TAB(12);" Z to speed up"TAB(12)" X to
pause"
200REPEAT
210VDU31,0,6,152,10,152
220P%=0
230FORDEL=1TOD%
240IF INKEY-99 IFP%=0 D%=D%+10:P%=1
250IF INKEY-98 IFP%=0 IF D%>0 D%=D%-10
:P%=1
260IF INKEY-67 PROCpause
270NEXT
280PROCp
290SOUND1,-5,100,1
300VDU31,0,6,133,10,134:FORDEL=1TO50:N
EXT
310R%=R%+1
320UNTILFALSE
330DEFPROCp
340T%=TIME/100
350IF T%=0 ENDPROC
360H%=T% DIV 3600
370M%=T% DIV 60-T%DIV3600*60
380S%=T% MOD 60
390B=R%/A%:REM MILES COVERED
400C=B/(T%/3600):REM AVERAGE SPEED
410PRINTTAB(24,12);STR$H%;":";STR$M%;"
:";STR$S%;" "
420@%=&0102020A:PRINTTAB(24,13);STR$B
430PRINTTAB(24,14);STR$C;" "
440@%=&90A
450ENDPROC
460DEFPROCpause
470O%=TIME
480VDU31,0,9,129,10,131
490PRINTTAB(12,21)" (L)oad status"
500PRINTTAB(12)" (S)ave status"
510PRINTTAB(12)" (C)ontinue"
520REPEAT
530A$=GET$
540UNTILINSTR("LlSsCc",A$)
550IF INSTR("Ll",A$):X%=OPENIN"CycDat"
:INPUT#X%,O%,R%,D%:CLOSE#X%
560IF INSTR("Ss",A$):X%=OPENOUT"CycDat
":PRINT#X%,O%,R%,D%:CLOSE#X%
570PRINTTAB(12,21)SPC100
580VDU31,0,9,152,10,152
590TIME=O%
600ENDPROC