8-Bit Software Online Conversion
Big Ben - Listing
10REM BIG BEN
20REM Local Time Calculator
30REM for 8 Bit Software
40REM by M.Bobrowski 8'92
50:
60MODE1:VDU 19,1,5;0;19,2,6;0;19,3,3;
0;
70COLOUR 1:PRINT'TAB(4)"When Big Ben
strikes twelve ...":*FX4,1
80DIM L$(39),D%(39):FOR I%=0 TO 39:RE
AD L$(I%),D%(I%):NEXT
90ON ERROR IF ERR=17 AND INKEY-1 THEN
170 ELSE IF ERR<>17 REPORT:PRINT" at ";
ERL:END
100GCOL 0,1:MOVE 0,116:DRAW 0,940:DRAW
1279,940:DRAW 1279,116:DRAW 0,116:VDU 5
,24,4;120;1275;936;28,2,31,37,29
110T%=720:N%=20:PROCtime
120REPEAT
130CLS:COLOUR2:PRINT"Use cursor keys t
o select the city"'"then press RETURN. E
SC+SHIFT to exit";
140PROCcursor(N%):PROCmove
150T%=FNinput(N%):PROCtime
160UNTIL FALSE
170VDU26,12:*FX4,0
180END
190:
200DEF FNinput(N%)
210LOCAL H%,M%:*FX15,1
220CLS:COLOUR 1:PRINT"What is the time
in ";L$(N%);" ?"
230REPEAT:COLOUR 2:PRINTTAB(0,1)"Hours
:";SPC9:COLOUR3:INPUTTAB(8,1)H%:IF H%<0
OR H%>23 VDU7
240UNTIL H%>=0 AND H%<24
250REPEAT:COLOUR 2:PRINT TAB(19,1)"Min
utes :";SPC7:COLOUR3:INPUT TAB(29,1)M%:I
F M%<0 OR M%>59 VDU 7
260UNTIL M%>=0 AND M%<60
270=H%*60+M%-D%(N%)
280:
290DEF PROCtime
300VDU 5,16:FOR I%=0 TO 39
310Q%=T%+D%(I%):IF Q%<0 Q%=Q%+1440 ELS
E IF Q%>=1440 Q%=Q%-1440
320GCOL 0,3:MOVE 48-608*(I%MOD2=1),920
-40*I%DIV2-20*(I%MOD2=1):PRINT L$(I%);
330GCOL 0,2:MOVE 464-608*(I%MOD2=1),92
0-40*I%DIV2-20*(I%MOD2=1):PRINT RIGHT$("
00"+STR$(Q% DIV 60),2);":";RIGHT$("00"+S
TR$(Q% MOD 60),2);
340NEXT:VDU 4
350ENDPROC
360:
370DEF PROCmove
380REPEAT
390G%=GET:IF G%=13 THEN 460
400PROCcursor(N%)
410IF G%=136 AND N%>0 N%=N%-1
420IF G%=137 AND N%<39 N%=N%+1
430IF G%=138 AND N%<38 N%=N%+2
440IF G%=139 AND N%>1 N%=N%-2
450PROCcursor(N%)
460UNTIL G%=13
470PROCcursor(N%)
480ENDPROC
490:
500DEF PROCcursor(N%):GCOL4,0
510LOCAL X%,Y%:IF N% MOD 2=0 X%=28 ELS
E X%=636
520Y%=928-40*(N% DIV 2)
530FOR J%=Y% TO Y%-40 STEP -4
540MOVE X%,J%:DRAW X%+608,J%
550NEXT
560ENDPROC
570:
580DATA Algiers,0,Athens,120,Baghdad,1
80,Bangkok,420,Beijing,480,Berlin,60,Bue
nos Aires,-180,Cairo,120,Caracas,-240,Ch
icago,-360
590DATA Havana,-240,Hong Kong,480,Hono
lulu,-600,Jakarta,420,Jerusalem,120,Joha
nnesburg,120,Kabul,270,Kathmandu,345,Lag
os,60,Lima,-300
600DATA London,0,Los Angeles,-480,Madr
id,60,Melbourne,600,Mexico,-360,Moscow,1
80,New Delhi,330,New York,-300,Paris,60,
Rangoon,390
610DATA Reykjavik,0,R.de Janeiro,-180,
Rome,60,Singapore,480,Stockholm,60,Tehra
n,210,Tokyo,540,Vienna,60,Warsaw,60,Well
ington,720