Hickory, Dickory,
Dock
Barbara H. Schulak
This fun, educational program helps children learn the concepts of telling time by relating a digital clock display to a conventional clock face. The original program is written for the Commodore 64 (and 128 in 64 mode). We've added new versions for Apple II-series computers, the IBM PC/ PCjr, Amiga, Atari 520ST, and Atari 400/800, XL, and XE computers.
"Hickory, Dickory, Dock" offers an enjoyable way for children to learn how to tell time. Type in the program for your computer, then save a copy before running it. Because every version works much the same, read the general instructions first, then refer to the specific notes for your computer.
When you run Hickory, Dickory, Dock, it displays a round clock face as well as a digital display. Four different activities are available. The first option lets youngsters practice telling time. As the positions of the clock hands change on the screen, the digital clock display changes as well. This shows the relationship between the spatial position of hands on a clock face and the numeric representation of time.
The other three activities test a youngster's time-telling ability for hours only, hours and half-hours, or five-minute intervals. Move the hands to the correct position, then press RETURN (or Enter) to enter the answer. After five correct answers, the program plays a brief song and displays some graphics as a reward. After three incorrect choices, the program automatically moves the clock hands to the correct position.
In the Commodore 64 version (which also works on the 128 in 64 mode), press the f7 function key to move the minute hand (the long green one), and the f5 function key to move the hour hand (short and yellow). If you press M at any point, the program returns to the main menu.
For all Atari versions (including the ST), press the H key to move the hours hand, press M to move the minutes hand, and press Q to return to the main menu. Before running the Atari ST version, you should select Low Resolution from the Preferences menu and turn off buffered graphics. (If your ST has the TOS operating system in Read Only Memory, there may be enough Random Access Memory left to run Hickory, Dickory Dock without turning off buffered graphics.)
The Amiga version includes speech synthesis and uses the mouse pointer instead of keyboard controls.
In the Apple and IBM PC/PCjr versions, press the 1 key to move the minutes hand, press 2 to move the hours hand, and press ESC to return to the main menu.
Program 1: Hickory,
Dickory, Dock For
Commodore 64
For instructions on entering this listing, please
refer to "COMPUTEI's Guide to Typing In
Programs" in this issue of COMPUTE!
AF 10 POKE53281,0:POKE53280,11
CP 20 PRINT"{CLR}{WHT}{8 DOWN}
"TAB(8)"HICKORY, DICKORY
, DOCK!
QR 30 PRINT"{10 DOWN}"TAB(14)"
PLEASE WAIT
XC 40 POKE56,48:CLR
DC 50 POKE650,128:X=RND(-TI)
GJ 60 DIM N(12),LO(12,6),CH(12
,6),NU(10,15),T1(12),T2(
12)
MB 70 S=54272:FORI=0TO24:POKES
+I,0:NEXT:POKES+24,15
MM 80 FORI=1TO30:READA$,A,B,C:
NEXT
DB 90 V=53248:POKE2040,13
RM 100 FORI=0TO63:READA:POKE83
2+I,A:NEXT
FQ 110 POKEV+39,2:POKEV+37,1:P
OKEV+38,6
SF 120 POKEV,150:POKEV+1,150
XM 130 POKEV+23,1:POKEV+29,1
MD 140 POKEV+28,1 :POKEV+21,1
PF 150 FORI=49152TO49152+81:RE
ADA:POKEI,A:NEXT
CS 160 SYS49152
JJ 170 FORI=0T0143:READA:POKE1
2288+101*8+I,A:NEXT
CB 180 FORI=1T012:READ N(I):NE
XT
JR 190 FORI=1TO12:FORJ=1TON(I)
:READLO(I,J):NEXT:NEXT
QS 200 FORI=IT012:FORJ=ITON(I)
:READCH(I,J):NEXT:NEXT
SM 210 FORI=OT09:FORJ=1TO15:RE
ADA$:IFA$="+"THENNU(I,J
)=160
KH 220 IFA$="-"THENNU(I,J)=32
ES 230 NEXT:NEXT
RJ 240 FORI=1TO12:READT1(I),T2
(I):NEXT
DA 250 RESTORE:POKEV+21,0
DR 260 PRINT"{CLR}{3 DOWN}
{WHT}CHOOSE ONE OF THE
{SPACE}FOLLOWING:
AX 270 PRINTTAB(5)"{2 DOWN}1.
{SPACE}TEST - HOURS
SB 280 PRINTTAB(5)"{DOWN}2. TE
ST - HOURS AND HALF HOU
RS
AK 290 PRINTTAB(5)"{DOWN}3. TE
ST - 5 MIN. INTERVALS
BR 300 PRINTTAB(5)"{DOWN}4. PR
ACTICE
JJ 310 PRINTTAB(5)"{DOWN}5. EN
D PROGRAM"
JK 320 GETKK$:IFKK$=""THEN320
KA 330 KK=VAL(KK$):IFKK<1ORKK>
5THEN320
JE 340 IFKK=5THENSYS2048:END
HX 350 POKE53272,(PEEK(53272)A
ND240)+12
SD 360 RA=0:WA=0
CD 370 PRINT"{CLR}{3 DOWN}"
PJ 380 PRINTTAB(19)"12"
XM 390 PRINTTAB(14)"11
{9 SPACES}1"
HF 400 PRINT:PRINTTAB(11)"10
{15 SPACES}2"
HR 410 PRINT:PRINT:PRINTTAB(11
)"9{8 SPACES}Q
{8 SPACES}3"
HS 420 PRINT:PRINT:PRINTTAB(12
)"8{15 SPACES}4"
CP 430 PRINT:PRINTTAB(15)"7
{9 SPACES}5"
DD 440 PRINTTAB(20)"6"
DP 450 PRINT"{3 DOWN}{YEL}F5=*
***
BB 460 PRINT"{GRN}F7=<*****
QX 470 PRINT"{WHT}RETURN=ANS.
GP 480 PRINT"M=MENU
JS 490 H=2:M=12:GOSUB950:GOSUB
1060
BH 500 POKE1844,160:POKE1844+S
,2
GE 510 POKE1924,160:POKE1924+S
,2
XB 520 IFKK=4THEN2470
EM 530 C=H:D=M:PRINT"{WHT}
{HOME}SET THE HANDS ON
{SPACE}THE CLOCK:"
FB 540 GOSUB1590:H=A:M=B:GOSUB
1230:GOSUB1450:H=C:M=D
KD 550 :
RP 560 POKE198,0
JF 570 K$="":GETK$:IFK$=""THEN
570
DR 580 IFK$="{F5}"THENGOSUB111
0
KG 590 IFK$="{F7}"THENGOSUB116
0
KB 600 IFK$=CHR$(13)THEN640
JE 610 IFK$="M"THEN260
MR 620 GOTO570
SJ 630 :
RK 640 IFH<>AORM<>BTHEN770
HP 650 PRINT"{HOME}{2 DOWN}"TA
B(17)"{RVS}[<7>]RIGHT!"
KQ 660 GOSUB2310
DH 670 FORI=1TO10
FD 680 PRINT"{HOME}{2 DOWN}"TA
B(17)"{RVS}RIGHT!"
QX 690 FORT=1T050:NEXT
MH 700 PRINT"{HOME}{2 DOWN}"TA
B(17)"RIGHT!"
DS 710 FORT=1T050:NEXT
CS 720 NEXT
DB 730 PRINT"{HOME}{2 DOWN}"TA
B(17)"{6 SPACES}"
CK 740 WA=0:RA=RA+1:IFRA=5THEN
RA=0:GOTO1700
MC 750 GOTO530
GB 760 :
HJ 770 PRINT"{HOME}{2 DOWN}"TA
B(17)"{PUR}WRONG!"
FF 780 GOSUB2390:WA=WA+I
SF 790 FORT=1TO1000:NEXT
CR 800 PRINT"{HOME}{2 DOWN}"TA
B(17)"{6 SPACES}"
GC 810 IFWA<3THEN570
KE 820 WA=0:PRINT"{HOME}{WHT)T
HE CORRECT TIME IS:
{7 SPACES}"
ME 830 GOSUB910:GOSUB1020
GK 840 H=A:M=B:GOSUB950:GOSUB1
060
XK 850 FORT=1TO2000:NEXT
HH 860 PRINT"{HOME}{20 SPACES}
"
HM 870 GOTO530
FK 880 :
FD 890 :CHANGE MINUTE HAND
AK 900 :
DQ 910 FORI=1TON(M)
CH 920 POKELO(M,I),32
PA 930 NEXT:RETURN
AQ 940 :
AD 950 FORI=1TON(M)
ME 960 POKELO(M,I),CH(M,I)
SX 970 POKELO(M,I)+S,5
JJ 980 NEXT:GOSUB2250:RETURN
HA 990 :
BB 1000 :CHANGE HOUR HAND
Sx 1010 :
BH 1020 FORI=1TON(H)-1
PK 1030 POKELO(H,I),32
MJ 1040 NEXT:RETURN
PC 1050 :
RP 1060 FORI=1TON(H)-1
KS 1070 POKELO(H,I),CH(H,I)
PK 1080 POKELO(H,I)+S,7
GP 1090 NEXT:GOSUB2250:RETURN
GF 1100 :
KK 1110 GOSUB910:GOSUB1020
FA 1120 H=H+1:IFH=13THENH=1
MB 1130 GOSUB1060:GOSUB950
KG 1140 RETURN
FK 1150 :
PF 1160 GOSUB910:GOSUB1020
KD 1170 M=M+1:IFM=13THENM=1
KR 1180 GOSUB1060:GOSUB950
MM 1190 RETURN
AP 1200 :
QR 1210 : CHANGE HOUR NUMBER
GR 1220 :
CP 1230 IFH<10THEN1300
EX 1240 K=0
AB 1250 FORI=1796TO1956STEP40
SP 1260 FORJ=0TO2:K=K+1
XH 1270 POKEI+J,NU(1,K):POKEI+
J+S,2
FJ 1280 NEXT:NEXT
FX 1290 TP=H-10:GOTO1310
EG 1300 TP=H
GD 1310 K=0
DC 1320 FORI=1800TO1960STEP40
XX 1330 FORJ=0TO2:K=K+l
QS 1340 POKEI+J,NU(TP,K):POKEI
+J+S,2
GQ 1350 NEXT:NEXT
DX 1360 IFH>9THENRETURN
AK 1370 FORI=1796TO1956STEP40
KD 1380 FORJ=0TO2:K=K+l
XR 1390 POKEI+J,32:POKEI+J+S,2
BS 1400 NEXT:NEXT
RK 1410 RETURN
FK 1420 :
EX 1430 :CHANGE MINUTE NUMBER
XP 1440 :
SQ 1450 T1=T1(M):T2=T2(M)
XS 1460 K=0
PJ 1470 FORI=1806TO1966STEP40
HE 1480 FORJ=0TO2:K=K+l
MH 1490 POKEI+J,NU(T1,K):POKEI
+J+S,2
EE 1500 NEXT:NEXT
FA 1510 K=0
GD 1520 FORI=1810TO1970STEP40
QM 1530 FORJ=0TO2:K=K+l
FP 1540 POKEI+J,NU(T2,K):POKEI
+J+S,2
FJ 1550 NEXT:NEXT
KD 1560 RETURN
RE 1570 :
HB 1580 :GET RANDOM TIME
HF 1590 :
HD 1600 G=INT(RND(1)*12)+1:IFG
=ATHEN1600
CR 1610 A=G
FA 1620 J=INT(RND(1)*12)+1
MQ 1630 IFKK=ITHENB=12:RETURN
JA 1640 IFKK=2ANDJ<6THENB=12:R
ETURN
MC 1650 IFKK=2THENB=6:RETURN
HJ 1660 B=J:RETURN
DM 1670 :
FX 1680 :HICKORY
RQ 1690 :
DC 1700 POKE53281,0:POKE53280,
11:PRINT"{CLR}"
JJ 1710 FORI=0TO24:POKEI+S,0:N
EXT
FX 1720 POKES+24,15:POKES+6,24
0
DE 1730 POKEV,250:POKEV+1,184
JG 1740 POKEV+21,1
SX 1750 PRINT"{3 DOWN}"TAB(30)
"{RVS}[<2>]{7 SPACES}"
PC 1760 PRINTTAB(30)"{RVS}[<8>]
{2 SPACES}B{2 SPACES}
[<2>] "
XM 1770 PRINTTAB(30)"{RVS} [<8>]
{2 SPACES}-{2 SPACES}
[<2>] "
KC 1780 PRINTTAB(30)"{RVS} [<8>]
{2 SPACES}Q*C[<2>] "
RP 1790 PRINTTAB(3)"{RVS} [<8>]
{5 SPACES}[<2>] "
RQ 1800 PRINTTAB(30)"{RVS}[<2>]
{7 SPACES}"
HB 1810 FORI=1TO9
XX 1820 PRINTTAB(30)"{RVS}
{2 RIGHT}{OFF}{YEL}-
{2 SPACES}{RVS}[<2>] "
RF 1830 NEXT
AM 1840 PRINTTAB(30)"{RVS}
{2 RIGHT}{OFF}{YEL}Q
{2 RIGHT}{RVS}[<2>] "
GC 1850 PRINTTAB(30)"{RVS}
{5 RIGHT} "
DC 1860 PRINTTAB(30)"{RVS}
{7 SPACES}{WHT}"
RF 1870 PRINT"{HOME}{5 DOWN}"
RX 1880 Z=7:GOSUB1970:PRINT
BK 1890 Z=S:GOSUB1970:PRINT
KS 1900 FORI=186TO50STEP-2:POK
EV+1,I:NEXT
"Hickory, Dickory, Dock" for the
Commodore 64 and 128, an amusing
educational program for children.
DX 1910 Z=4:GOSUB1970:PRINT
KM 1920 POKE133P,160:POKE1257,
194:POKE1298,206:POKE1
338+S,15:POKE1298+5,15
FS 1930 POKE1339,160:Z=4:GOSUB
1970:PRINT
KS 1940 FORI=50TO186STEP2:POKE
V+1,I:NEXT
DQ 1950 Z=7:GOSUB1970:GOTO250
FQ 1960 :
JE 1970 FORI=1TOZ
SM 1980 READA$,A,B,C:POKES+4,1
7
XJ 1990 PRINTA$;:POKES+1,A:POK
ES,B
QB 2000 FORT=1TOC:NEXT:POKES+4
,16
EE 2010 NEXT:RETURN
ES 2020 :
BX 2030 :
AS 2040 DATA "HICK",12,32,125,
"0",12,216,125,"RY, ",
14,107,125,"DICK",14,1
07,125
HX 2050 DATA "0",16,47,125,"RY
, ",18,42,125,"DOCK!",
19,63,1000
JS 2060 DATA "THE ",12,32,125,
"MOUSE",12,32,125," ",
12,216,125,"RAN ",14,1
07,125
KH 2070 DATA "UP ",14,107,125,
,16,47,125,"THE ",18,4
2,125,"CLOCK.",19,63,1
000
QP 2080 DATA "THE ",14,107,125
,"CLOCK ,19,63,250,"S
TRUCK ",19,63,125
SE 2090 DATA "ONE,",18,42,250,
"THE ",18,42,125,"MOUS
E ",16,47,250
HG 2100 DATA "RAN ",16,47,125,
"DOWN.",14,107,1000
PC 2110 DATA "HICK",14,107,125
,"OR",16,47,124,"Y, ",
14,107,125,"DICK",12,2
16,125
JS 2120 DATA "O",12,32,125,"RY
, ",10,205,125,"DOCK!"
,9,159,1000
MG 2130 :
DH 2140 DATA 5,64,84,5,64,84,5
,85
AK 2150 DATA 84,0,85,80,0,68,6
4,0
FJ 2160 DATA 85,64,16,81,65,16
,21,1
XX 2170 DATA 16,4,1,31,255,253
,15,255
SA 2180 DATA 252,0,255,192,0,2
55,192,0
EM 2190 DATA 255,192,65,170,12
8,68,162,128
BD 2200 DATA 80,162,128,0,162,
128,0,17
GD 2210 DATA 0,0,17,0,1,81,80,
255
BP 2220 :
HA 2230 :MUSIC SUBS
XR 2240 :
CR 2250 POKES+5,0:POKES+6,2
DQ 2260 POKES+4,129
DC 2270 POKES,100:POKES+1,100
DT 2280 FORT=ITOIO:NEXT
SH 2290 POKES+4,128:RETURN
MA 2300 :
SA 2310 POKES+5,0:POKES+6,240
PB 2320 FORI=1TO10
XC 2330 POKES+4,17
KF 2340 POKES,100:POKES+1,20
XA 2350 FORT=1TO50:14EXT
GA 2360 POKES+4,16
DQ 2370 NEXT:RETURN
CG 2380 :
KX 2390 POKES+6,240:POKES+5,0
QG 2400 POKES+4,17
CR 2410 POKES,108:POKES+1,6
BS 2420 FORT=1TO300:NEXT
BQ 2430 POKES+4,16:RETURN
QM 2440 :
JR 2450 :LEARNING MODULE
GP 2460 :
XJ 2470 PRINT"{2 UP}
{11 SPACES}"
QX 2480 GOSUB1230:GOSUB1450
MP 2490 K$="":GETK$:IFK$=""THE
N2490
DD 2500 IFK$="{F5}"THENGOSUB11
10:GOSUB1230
CA 2510 IFK$="{F7}"THENGOSUB11
60:GOSUB1450
DA 2520 IFK$="M"THEN260
KE 2530 GOTO2490
PA 2540 :
MG 2550 :ML DATA
RC 2560 :
HK 2570 DATA 173,14,220,41,254
,141,14,220
RF 2580 DATA 165,1,41,251,133,
1,160,0
QJ 2590 DATA 185,0,208,153,0,4
8,185,0
KA 2600 DATA 209,153,0,49,185,
0,210,153
PA 2610 DATA 0,50,185,0,211,15
3,0,51
SF 2620 DATA 185,0,212,153,0,5
2,185,0
HA 2630 DATA 213,153,0,53,185,
0,214,153
HS 2640 DATA 0,54,185,0,215,15
3,0,55
AG 2650 DATA 200,208,205,165,1
,9,4,133
CJ 2660 DATA 1,173,14,220,9,1,
141,14
XG 2670 DATA 220,96
RM 2680 :
AM 2690 :
AS 2700 :CHAR DATA
GM 2710 :
XE 2720 DATA 1,2,4,8,16,32,64,
128
XG 2730 DATA 128,64,32,16,8,4,
2,1
JE 2740 DATA 0,0,0,0,0,3,28,22
4
KF 2750 DATA 0,0,1,14,112,128,
0,0
FD 2760 DATA 7,56,192,0,0,0,0,
0
RQ 2770 DATA 192,56,7,0,0,0,0,
0
FK 2780 DATA 0,0,128,112,14,1,
0,0
GH 2790 DATA 0,0,0,0,0,224,28,
3
GS 2800 DATA 8,12,14,255,255,1
4,12,8
FD 2810 DATA 24,24,24,24,24,12
6,60,24
JQ 2820 DATA 31,15,15,31,57,11
2,224,192
DH 2830 DATA 192,224,112,57,31
,15,15,31
SC 2840 DATA 3,7,14,156,248,24
0,240,248
BP 2850 DATA 248,240,240,248,1
56,14,7,3
QX 2860 DATA 0,0,254,62,126,13
4,2,0
RH 2870 DATA 0,0,127,124,126,9
7,64,0
FS 2880 DATA 0,0,0,2,134,126,6
2,254
FC 2890 DATA 0,0,0,64,97,126,1
24,127
EG 2900 :
QK 2910 :HOUR HAND DATA
MJ 2920 :
CB 2930 DATA 3,5,6,5,3,4,3,5,6
,5,3,4
AG 2940 DATA 1405,1366,1327
EJ 2950 DATA 1405,1406,1407,13
68,1369
KM 2960 DATA 1445,1446,1447,14
48,1449,1450
CG 2970 DATA 1485,1486,1487,15
28,1529
FA 2980 DATA 1485,1526,1567
JE 2990 DATA 1484,1524,1564,16
04
XG 3000 DATA 1483,1522,1561
GD 3010 DATA 1483,1482,1481,15
20,1519
SQ 3020 DATA 1443,1442,1441,14
40,1439,1438
HC 3030 DATA 1403,1402,1401,13
60,1359
QS 3040 DATA 1403,1362,1321
SP 3050 DATA 1404,1364,1324,12
84
CD 3060 DATA 78,78,111
RE 3070 DATA 103,104,105,103,1
15
CP 3080 DATA 67,67,67,67,67,10
9
AG 3090 DATA 106,107,108,106,1
17
QB 3100 DATA 77,77,112
FC 3110 DATA 93,93,93,110
SF 3120 DATA 78,78,113
MS 3130 DATA 105,104,103,105,1
18
QR 3140 DATA 67,67,67,67,67,31
PD 3150 DATA 108,107,106,108,1
16
QJ 3160 DATA 77,77,114
CJ 3170 DATA 93,93,93,30
EJ 3180 :
JP 3190 :NUMBER DATA
GJ 3200 :
AX 3210 DATA +,+,+,+,-,+,+,-,+
,+,-,+,+,+,+
SE 3220 DATA -,+,-,-,+,-,-,+,-
,-,+,-,-,+,-
JD 3230 DATA +,+,+,-,-,+,+,+,+
,+,-,-,+,+,+
KG 3240 DATA +,+,+,-,-,+,-,+,+
,-,-,+,+,+,+
KR 3250 DATA +,-,+,+,-,+,+,+,+
,-,-,+,-,-,+
BG 3260 DATA +,+,+,+,-,-,+,+,+
,-,-,+,+,+,+
MD 3270 DATA +,+,+,+,-,-,+,+,+
,+,-,+,+,+,+
AF 3280 DATA +,+,+,-,-,+,-,-,+
,-,-,+,-,-,+
GD 3290 DATA +,+,+,+,-,+,+,+,+
,+,-,+,+,+,+
JS 3300 DATA +,+,+,+,-,+,+,+,+
,-,-,+,-,-,+
DX 3310 :
JJ 3320 :MORE DATA
GA 3330 :
HJ 3340 DATA 0,5,1,0,1,5,2,0,2
,5,3,0
KQ 3350 DATA 3,5,4,0,4,5,5,0,5
,5,0,0
Program 2: Hickory,
Dickory, Dock For Atari
400/800/XL/XE
Version by Kevin Mykytyn, Editorial Programmer
For instructions on entering this listing, please
refer to "COMPUTU's Guide to Typing In
Programs" in this issue of COMPUTE!.
PN 10 GOTO 30
IG 20 X=INT(XC-XR*COS(A)):Y=
INT(YC-YR*SIN(A)):RETU
RN
PC 30 DIM A$(5),K$(1),TIMES(
5):OPEN #1,4,8,"K:":PO
KE 82,0
BM 40 GRAPHICS 18:PRINT #6;"
1. {RVS}TEST{OFF} hours":PRINT #
6:PRINT #6;"2. {RVS}TEST{OFF} ho
urs and{6 SPACES}half
hours"
AL 50 PRINT #6:PRINT #6;"3.
{RVS}TEST{OFF} five minute
{4 SPACES}intervals":P
RINT #6:PRINT #6;"4. {RVS}P
RACTICE{OFF}"
JB 60 PRINT #6:PRINT #6;"5.
{RVS}QUIT{OFF}"
NL 70 GET #1,K:K$=CHR$(K):IF
K$<"1" OR K$>"5" THEN
70
OA 80 N=VAL(KS):IF N=5 THEN
GRAPHICS 0:END
HN 90 IF N=4 THEN 250
KM 100 GOSUB 290
LH 110 HR-INT(RND(1)*12)+1:M
N=0:IF N=2 THEN MN=IN
T(RND(1)+0.5)*30:GOTO
130
HF 120 IF N=3 THEN MN=INT(RN
D(1)*12)*5
EA 130 GOSUB 48O:AMN=MN:AHR=
HR:MN=0:HR=12
JN 140 GOSUB 440:GOSUB 540:I
F K$="Q" THEN 40
LP 150 IF K$<>CHR$(155) THEN
140
EF 160 POKE 656,0:POKE 657,8
:IF AMN<>MN OR AHR<>H
R THEN 190
BE 170 NR=NR+1:NW=0:PRINT "R
IGHT!";:FOR A=15 TO 0
STEP -1
FE 180 SOUND 1,121,10,A:SOUN
D 2,81,10,A:FOR T=1 T
O 10:NEXT T:NEXT A:GO
SUB 230:GOTO 210
ON 190 MN=AMN:HR=AHR:PRINT "
WRONG!";:FOR A=10 TO
150:SOUND 1,A,12,15:N
EXT A:GOSUB 230:NW=NW
+1:IF NW<>3 THEN 130
This version of "Hickory, Dickory,
Dock" runs on all Atari 400/800, XL,
and XE computers.
PC 200 NW=0:GOSUB 440:GOSUB
480:FOR TD=1 TO 1500:
NEXT TD:GOTO 110
MI 210 IF NR=5 THEN NR=0:GOS
UB 590
FP 220 GOTO 110
PB 230 SOUND 2,0,0,0:SOUND 1
,0,0,0:FOR TD=1 TO 60
0:NEXT TD:PRINT "
{6 LEFT}{7 SPACES}";:
RETURN
EM 240 FOR T=1 TO 1500:NEXT
T:GOTO 40
LC 250 GOSUB 290
GH 260 GOSUB 440:GOSUB 480:G
OSUB 540:IF KS<>"Q" T
HEN 260
DG 270 GOTO 40
PJ 280 REM DRAW THE CLOCK
LC 290 GRAPHICS 6:SETCOLOR 2
,0,0:GOSUB 410:COLOR
1:XC=80:YC=38:YR=28:X
R=YR*1.2:GOSUS 340:XR
=XR+B:YR=YR+6:YC=YC-4
DH 300 NW=0:NR=0:POKE 656,0:
POKE 657,25:PRINT "(H
)OURS{5 SPACES}(M)INU
TES{5 SPACES}(Q)UIT"
MM 310 FOR Q=1 TO 12:A$=STR$
(Q):A=Q*30+90:GOSUB 2
0:X=INT(X/8):GOSUB 38
0:NEXT Q:XR=XR-10:YR=
YR-10:YC=YC+4
DN 320 HR=12:MN=0:OMX=XC:OHX
=XC:OMY=YC:OHY=YC:RET
URN
EI 330 REM CIRCLE DRAWING SU
BROUTINE
CL 340 DEG :FOR A=0 TO 360 S
TEP 10:GOSUB 20
CA 350 IF A=0 THEN PLOT X,Y
BL 360 DRAWTO X,Y:NEXT A:RET
URN
IM 370 REM CHARACTER PLOTTIN
G SUBROUTINE
GD 380 CHROM=57344:SCREEN=PE
EK(88)+256*PEEK(89)+X
+Y*20-(LEN(AS)=2)
ND 390 FOR A=1 TO LEN(AS):CS
=CHROM+ASC(A$(A,A))*8
-256
KN 400 FOR B=0 TO 7:POKE SCR
EEN+B*20,PEEK(CS+B):N
EXT B:SCREEN=SCREEN+1
:NEXT A:RETURN
LK 410 DL=PEEK(560)+256*PEEK
(561):POKE DL+85,71:P
OKE DL+BB,2:POKE DL+S
9,65
AM 420 POKE DL+90,PEEK(560):
POKE DL+91,PEEK(561):
RETURN
AH 430 REM OUTPUT CLOCK TIME
DF 440 COLOR 0:PLOT XC,YC:DR
AWTO OMX,OMY:PLOT XC,
YC:DRAWTO OHX,OHY
FC 450 COLOR 1:A=MN*6+90:GOS
UB 20:PLOT XC,YC:DRAW
TO X,Y:XR=XR/2:YR=YR/
2:OMX=X:OMY=Y
MC 460 A=HR*30+90+MN/2:GOSUB
20:PLOT XC,YC:DRAWTO
X,Y:XR=XR*2:YR=YR*2:
OHX=X:OHY=Y:RETURN
EJ 470 REM OUPUT DIGITAL TIM
E
NK 480 POKE 656,0:POKE 657,8
:POKE 658,0:IF HR<10
THEN PRINT " ";
HE 490 TIME$=STR$(HR):GOSUB
520:PRINT CHR$(154);
DO 500 IF MN<10 THEN PRINT C
HR$(144);
CP 510 TIME$=STR$(MN)
IP 520 FOR A=1 TO LEN(TIME$)
:PRINT CHR$(ASC(TIME$
(A,A))+96);:NEXT A:RE
TURN
HH 530 REM CHANGE TIME ROUTI
NE
AN 540 GET #1,K:K$=CHR$(K):I
F K$="M" THEN MN=MN+5
:IF MN=60 THEN MN=0
FN 550 IF K$="H" THEN HR=HR+
1
JM 560 IF HR=13 THEN HR=1
GM 570 IF K$="M" OR K$="H" O
R K$=CHR$(155) OR K$=
"Q" THEN RETURN
GP 580 GOTO 540
FK 590 RESTORE 620
DJ 600 READ NT,L:IF NT=-1 TH
EN SOUND 1,0,0,0:RETU
RN
FG 610 SOUND 1,NT,10,15:FOR
A=1 TO L*40:NEXT A:SO
UND 1,0,0,0:GOTO 600
IG 620 DATA 81,1,72,1,81,1,9
1,1,96,1,108,1,121,5,
96,1,81,1,72,1,81,1,9
1,1,96,1,108,1,121,5
KH 630 DATA 96,1 108,2,108,1
,72,3,81,2,81,1,60,3,
81,1,72,1,81,1,91,1,9
6,1,108,1,121,6,-1,-1
Program 3: Hickory,
Dickory, Dock For Apple
Version by Tim Victor, Editorial Programmer
For instructions on entering this listing, please
refer to "COMPUTE!'s Guide to Typing In
Programs" in this issue of COMPUTE!.
6F 100 PI = 4 * ATN (1)
ED 110 DIM DP(4,7),CX(12),CY(12)
77 120 GOSUB 840: GOSUB 960: GOS
UB 1120: GOSUB 1160: POKE
6,0: POKE 7,138
25 130 IF PEEK (190 * 256) = 76
THEN PRINT CHR$ (4);"PR#A
$300": GOTO 150
BA 140 POKE 54,0: POKE 55,3: CAL
L 1002
32 150 HGR : GOSUB 510
39 160 HGR : HOME : GOSUB 600
IE 170 VTAB 19: HTAB 16: PRINT "
1": HTAB 16: PRINT "2"
IC 180 FOR I = 0 TO 1: HCOLOR= 5
+ I: FOR J = 0 TO 1: HPL
OT 18,147 + J + 8 * I TO
52 + 8 * 1,147 + J + 8
I: NEXT : NEXT
85 190 VTAB 21: HTAB 3: PRINT "T
O MOVE";: HTAB 14: PRINT
"PRESS": HTAB 2: PRINT "T
HIS HAND";: HTAB 13: PRIN
T "THIS KEY"
BB 200 CH = 213: FOR CV = 138 TO
150 STEP 12: GOSUB 770:
NEXT
3C 210 FOR I = 1 TO 4:DD(I) = 10
: FOR J = 1 TO 7:DP(I,J)
= 0: NEXT : NEXT
E5 220 HH = 84:HV = 35:MH = 83:11
V = 24
DA 230 IF GM = 4 THEN 410
46 240 NW = 0:TH = INT ( RND (1)
* 12) + 1:TM = INT ( RND
(1) * 60)
IE 250 IF GM = 1 THEN TM = 0
B6 260 IF GM = 2 THEN TM = 30
INT (TM / 30)
5C 270 IF GM = 3 THEN TM = 5 * I
NT (TM / 5)
77 280 HR = TH:MN = TM: GOSUB 61
0
"Hickory, Dickory, Dock" for Apple
computers offers children a fun way to
learn about telling time.
C5 290 HR = 1: MN = 0
4C 300 VTAB 24: HTAB 2: PRINT "P
RESS RETURN TO ANSWER, ES
C FOR MENU";
4F 310 GOSUB 670
CF 320 GOSUB 460: IF A$ = CHR$
27) THEN 150
33 330 IF A$ = CHR$ (13) THEN 35
0
96 340 GOTO 310
23 350 IF TH = HR AND TM = MN TH
EN 390
47 360 NW = NW + 1: IF NW < 3 TH
EN VTAB 24: HTAB 2: PRINT
SPC( 38);: HTAB 5: PRINT
"THAT IS NOT CORRECT, TR
Y AGAIN";: FOR I = 1 TO 1
000: NEXT : GOTO 300
CB 370 HR = TH:MN = TM: GOSUB 67
0: VTAB 24: HTAB 2: PRINT
SPC( 38);: HTAB 7: PRINT
"THIS IS THE CORRECT ANS
WER";
DE 380 FOR I = 1 TO 1500: NEXT :
GOTO 240
37 390 VTAB 24: HTAB 2: PRINT SP
C( 38);: HTAB 10: PRINT "
CORRECT! GOOD ANSWER";
7F 400 FOR I = 1 TO 1000: NEXT
GOTO 240
DD 410 VTAB 24: HTAB 11: PRINT "
PRESS ESC FOR MENU";
89 420 HR = 1 : MN = 0
19 430 GOSUB 610: GOSUB 670
D4 440 GOSUB 460: IF A$ = CHR$
27) THEN 150
IC 450 GOTO 430
2A 460 VTAB 24: HTAB 1: GET A$:
IF A$ = CHR$ (27) THEN RE
TURN
94 470 IF A$ = CHR$ (13) THEN RE
TURN
AE 480 IF A$ = "1" THEN HR = HR
+ 1 - 12 * (HR = 12): RET
URN
EF 490 IF A$ = "2" THEN MN = MN
+ 5 - 60 * (MN = 55): RET
URN
16 500 GOTO 460
56 510 TEXT : HOME : VTAB 6: HTA
B 8: PRINT "PRESS KEY TO
CHOOSE GAME:"
76 520 VTAB 10: HTAB 7: PRINT "1
: HOURS TEST"
E8 530 VTAB 12: HTAB 7: PRINT "2
: HOURS AND HALF HOURS TE
ST"
02 540 VTAB 14: HTAB 7: PRINT "3
: 5 MINUTE INTERVALS TEST
"
38 550 VTAB 16: HTAB 7: PRINT "4
: PRACTICE"
59 560 VTAB 18: HTAB 7: PRINT "5
: QUIT"
26 570 VTAB 24: GET A$: IF A$ <
"1" OR A$ > "5" THEN 570
58 580 IF A$ = "5" THEN END
6B 590 GM = VAL (A$): RETURN
69 600 FOR I = 1 TO 12: VTAB CY(
I): HTAB CX(I): PRINT 1:
NEXT : RETURN
CE 610 DE = 1:HC = 160:DC = INT
(HR / 10): IF DC = 0 THEN
DC = 10
AC 620 IF DC < > DD(1) THEN GOSU
B 790
45 630 DD(1) = DC:HC = 186:DE =
2:DC = HR - 10 * INT (HR
/ 10): IF DC < > DD(2) TH
EN GOSUB 790
6F 640 DD(2) = DC: HC = 220:DE =
3:DC = INT (MN / 10): IF
DC < > DD(3) THEN GOSUB 7
90
84 650 DD(3) = DC:HC = 246:DE =
4:DC = MN - DC * 10: IF D
C < > DD(4) THEN GOSUB 79
0
13 660 DD(4) = DC: RETURN
95 670 HCOLOR= 0: GOSUB 700: GOS
UB 720
A7 680 GOSUB 690: GOSUB 710: RET
URN
E3 690 A = (HR / 6 + MN / 360) *
PI:HV = 68 - 33 * COS (A
):HH = 84 + 44 * SIN (A):
HCOLOR= 5
F6 700 HPLOT 84,68 TO HH,HV: HPL
OT 83,67 TO HH - 1,HV - 1
: RETURN
94 710 A = MN / 30 * PI:MV = 68
- 44 * COS (A):MH = 83 +
59 * SIN (A): HCOLOR= 6
DC 720 HPLOT 84,68 TO MH,MV: HPL
OT 83,67 TO MH - 1,MV - 1
: RETURN
65 730 FOR I = - 2 TO 2: HPLOT C
H + I,CV - 4 + ( ABS (I)
= 2) TO CH + I,CV + 4 -
ABS (I) = 2): NEXT
1F 740 RETURN
5B 750 FOR I = - 1 TO 1: HPLOT C
H - 5 - (I = 0),CV + I TO
CH + 5 + (I = 0),CV + I:
NEXT
23 760 RETURN
27 770 HCOLOR= 2: FOR I = - 2 TO
2: HPLOT CH + I,CV - 2 +
( ABS (I) < 2) TO CH + I
,CV + 2 - ( ABS (I) < 2):
NEXT
27 780 RETURN
IB 790 CI = 0:CH = HC + 10: FOR
CV - 132 TO 156 STEP 12:
GOSUB B30: IF DP(DE,CI) <
> PC THEN GOSUB 750:DP(D
E,CI) = PC
FF 800 NEXT
7A 810 FOR CV = 138 TO 150 STEP
12: FOR CH = HC + 2 TO HC
+ 18 STEP 16: GOSUB 830:
IF DP(DE,CI) < > PC THEN
GOSUB 730:DP(DE,CI) = PC
5E 820 NEXT : NEXT : RETURN
CB 830 CI = CI + 1:PC = VAL ( MI
D$ (SS$(DC),CI,l)): HCOLO
R= 2 * PC: RETURN
F0 840 FOR I = 35456 TO I + 72 S
TEP 8: POKE 1,128: POKE I
+ 7,128
D8 850 FOR J = 1 TO 6: READ A: P
OKE I + J,A: NEXT : NEXT
: RETURN
90 860 DATA 188,230,246,238,230,
188
11 870 DATA 152,156,152,152,152,
188
75 880 DATA 188,230,176,140,230,
254
88 890 DATA 188,230,176,224,230,
188
9F 900 DATA 176,184,180,254,176,
176
5D 910 DATA 254,134,190,224,230,
188
79 920 DATA 188,134,190,230,230,
188
8A 930 DATA 254,224,176,152,140,
140
14 940 DATA 188,230,188,230,230,
188
80 950 DATA 188,230,230,252,176,
152
E8 960 FOR I = 768 TO I + 87: RE
AD A: POKE I,A: NEXT : RE
TURN
A4 970 DATA 216,120,133,69,134,7
0
51 980 DATA 132,71,166,7,10,10
1B 990 DATA 176,4,16,62,48,4
A2 1000 DATA 16,1,232,232,10,134
4A 1010 DATA 27,24,101,6,133,26
8D 1020 DATA 144,2,230,27,165,40
7F 1030 DATA 133,8,165,41,41,3
68 1040 DATA 5,230,133,9,162,8
28 1050 DATA 160,0,177,26,36,50
73 1060 DATA 48,2,73,127,164,36
57 1070 DATA 145,8,230,26,208,2
AF 1080 DATA 230,27,165,9,24,105
IF 1090 DATA 4,133,9,202,208,226
71 1100 DATA 165,69,166,70,164,7
1
3C 1110 DATA 88,76,240,253
Al 1120 FOR DC = 0 TO 10: READ S
S$(DC): NEXT : RETURN
12 1130 DATA 1011111,0000101,111
0110,1110101
14 1140 DATA 0101101,1111001,111
1011,1000101
BE 1150 DATA 1111111,1111101,000
0000
42 1160 FOR I = 1 TO 12: READ CY
(I),CX(I): NEXT : RETURN
AC 1170 DATA 2,18,5,22,9,23
23 1180 DATA 13,22,16,18,17,12
5B 1190 DATA 16,6,13,2,9,1
65 1200 DATA 5,2,2,6,1,12
Program 4: Hickory,
Dickory, Dock For IBM
PC/PCjr
Version by Tim Victor, Editorial Programmer
For instructions on entering this listing, please
refer to "COMPUTE!'s Guide to Typing In
Programs" in this issue of COMPUTE!.
PK 10 KEY OFF:RANDOMIZE TIMER
MN 20 DIM DD(4),DS(4,7),SS$(10),
CH(12),CV(12)
HO 30 DIM DH(5),DV(5)
FB 40 PI=4*ATN(1)
HP 50 GOSUB 900:GOSUB 940:GOSUB
840
6A 60 GOSUB 300
KC 70 SCREEN 1
CH 80 GOSUB 530:GOSUB 540:GOSUB
400
CH 90 FOR CP=0 TO 3:DD(CP)=10:FO
R SN=1 TO 7:DS(CP,SN)=0:NE
XT:NEXT
JM 100 HH=84:HV=36:MH=84:MV=21
BI 110 IF GM<4 THEN 160
OA 120 HR=1:MN=O:GOSUB 700:GOSUB
550
IA 130 LOCATE 25,11:PRINT "Press
Esc to quit";
PH 140 GOSUB 500:IF K$=CHR$(27)
THEN 60
GC 150 GOSUB 700:GOSUB 550:GOTO
140
PA 160 NC=0
NE 170 NW=0:HR=INT(12*RND(1))+1
LD 180 IF GM=1 THEN MN=0
PM 190 IF GM=2 THEN MN=30*INT(2*
RND(1))
DO 200 IF GM=3 THEN MN=5*INT(12*
RND(1))
BM 210 GOSUB 700:TH=HR:TM=MN:HR=
1:MN=0
LG 220 LOCATE 25,3:PRINT "Press
Enter to answer, Esc to q
Uit.";
EJ 230 K$=-":WHILE K$<>CHR$(27)
AND K$<>CHR$(13):GOSUB 55
0:GOSUB 500:WEND
PL 240 IF K$=CHR$(27) THEN 60
CA 250 LOCATE 25,3:IF HR=TH AND
MN-TM THEN 280
IH 260 NW=NW+I:IF NW<3 THEN PRIN
T SPACE$(8) "That's not c
orrect"SPACE$(8);:NC-0:FO
R DLAY=1 TO 500:NEXT:GOTO
220
LB 270 HR=TH:MN=TM:GOSUB 550:PRI
NT SPACE$(4) "This is the
correct answer" SPACE$(4
);:FOR I=1 TO 1500:NEXT:G
OTO 170
JD 280 PRINT SPACE$(10) "You're
right!" SPACE$(11);:NC=NC
+1:IF NC-5 THEN NC=0:GOSU
B 460
6B 290 FOR DLAY=1 TO 1500:NEXT:G
OTO 170
NO 300 SCREEN O:WIDTH 40:CLS
BB 310 LOCATE 6,8:PRINT "Press k
my to select game:"
ON 320 LOCATE 8,5:PRINT "1. Hour
s test"
18 330 LOCATE 9,5:PRINT "2. Hour
s and half hours test"
LH 340 LOCATE 10,5:PRINT "3. Fiv
e minute intervals test"
DH 350 LOCATE 11,5:PRINT "4. Pra
ctice"
NC 360 LOCATE 12,5:PRINT "5. Qui
t"
NA 370 K$=INPUT$(1):IF K$<"1" OR
K$>115" THEN 370
"Hickory, Dickory, Dock" for the IBM
PC/PCjr.
JN 380 IF K$="5" THEN END
PA 390 GM=VAL(K$):RETURN
IE 400 LOCATE 1,23:PRINT " To mo
ve Press";
D6 410 LOCATE 2,23:PRINT "this h
and this key";
C6 420 LOCATE 4,37:PRINT "1":LOC
ATE 5,37:PRINT "2"
DF 430 LINE (196,27)-(235,28),2,
BF
PA 440 LINE (196,35)-(235,36),1,
BF
NI 450 RETURN
CP 460 PLAY "mnt180o318gggaaal2g
l4n0lBg14el8e14fI8fl2el4n
0"
LC 470 PLAY "l8el4cl8c14el8e14d1
Bdl4a."
KA 480 PLAY ,milegagfedl4c."
NA 490 RETURN
FI 500 K$=INPUT$(1):IF K$="1" TH
EN HR-HR+1+12*(HR=12)
EA 510 IF K$-"2" THEN MN=MN+5+60
*(MN-55)
MD 520 RETURN
ON 530 FOR I=1 TO 12:LOCATE CV(I
),CH(I):PRINT MID$(STR$(I
),2):NEXT:RETURN
BA 540 LH=241:FOR LV=128 TO 149
STEP 21:LINE (LH,LV)-(LH+
5,LV+6),3,BF:NEXT:RETURN
DK 550 LINE (84,76)-(HH,HV),0
DN 560 LINE (83,75)-(HH-1,HV-1),
0
NL 570 LINE (84,76)-(MH,MV),0
BI 580 LINE (83,75)-(MH-1,MV-1),
0
IB 590 HH=84+48*SIN(PI*(HR/6+MN/
360))
FM 600 HV=76-40*COS(PI*(HR/6+MN/
360))
CH 610 LINE (84,76)-(HH,HV),2
6C 620 LINE (83,75)-(HH-1,HV-1),
2
DO 630 MH=84+63*SIN(PI*MN/30)
IJ 640 MV=76-55*COS(PI*MN/30)
OC 650 LINE (84,76)-(MH,MV),1
CD 660 LINE (83,75)-(MH-1,MV-1),
1
NO 670 RETURN
HO 680 LINE (83,75)-(HH-1,HV-1),
2
EK 690 MH=84+63*SIN(PI*MN/30)
MK 700 CP=0:DC=INT(HR/10):IF DC=
0 THEN DC=10
MK 710 GOSUB 760
DL 720 CP=1:DC=HR-10*INT(HR/10):
GOSUB 760
CJ 730 CP=2:DC=INT(MN/10):GOSUB
760
MM 740 CP=3:DC=MN-IO*DC:GOSUS 76
0
ML 750 RETURN
IP 760 IF DD(CP)=DC THEN RETURN
ELSE DD(CP)=DC
LL 770 SN=0:FOR SV=0 TO 40 STEP
20:G0SUB 810:IF DS(CP,SN)
<>HC THEN GOSUB 820:DS(CP
,SN)-HC
OD 780 NEXT
DM 790 FOR SV=0 TO 20 STEP 20:FO
R SH=0 TO 24 STEP 24:GOSU
B B10:IF DS(CP,SN)<>HC TH
EN GOSUB 830:DS(CP,SN)=HC
FL 800 NEXT:NEXT:RETURN
FP B10 SN=SN+1:HC=(MID$(SS$(DC),
SN,1)-"1"):RETURN
JC 820 PUT (174+CP#36-12!(CP>1),
120+SV),DH,XOR:RETURN
ID 830 PUT (170+CPt36-12t(CP>1)+
SH,123+SV),DV,XOR:RETURN
LM 840 SCREEN 1:CLS
GG 850 FOR LV=0 TO 3:LINE (1+(LV
=1 OR LV=2),LV)-(18-(LV=1
OR LV=2),LV),3:NEXT
LG 860 GET (0,0)-(19,3),DH:PUT
0,0),DH,XOR
LO 870 FOR LH=0 TO 3:LINE (LH,1+
(LH=1 OR LH=2))-(LH,16-(L
H=1 OR LH=2)),3:NEXT
ON 880 GET (0,0)-(3,17),DV:PUT
0,0),DV,XOR
NE 890 RETURN
HB 900 FOR DC=0 TO 10:READ SS$(D
C):NEXT:RETURN
BI 910 DATA "1011111","0000101",
"1110110","1110101"
00 920 DATA "0101101","1111001",
"1111011","1000101"
NN 930 DATA "1111111","1111101'-,
"0000000"
OD 940 FOR I=1 TO 12:READ CV(I),
CH(I):NEXT:RETURN
NN 950 DATA 2,16,6,20,10,21
I6 960 DATA 14,20,18,16,19,11
FD 970 DATA 18,6,14,2,10,1
M6 980 DATA 6,2,2,6,1,11
Program 5: Hickory,
Dickory, Dock For Atari ST
Version by Kevin Mykytyn, Editorial Programmer
10 randomize 0:goto 30
20 z=a*.0175:x=int(xc-xr*cos(z)):y=int(y
c-yr*sin(z)):return
30 ch=16:gosub 470:openw 2:clearw 2:fu1
lw 2:ohx=130:omx=130:ohy=75:omy
=75
40 nr=0:xr=70:yr=60:xc=130:yc=75:got
oxy 0,5:color 6:print"1. Test-hours"
50 print:print " 2. Test-hours and half ho
urs"
60 print:print " 3. Test-five minute inter
vals"
The Atari ST version of "Hickory,
Dickory, Dock."
70 print:print" 4.Practice":print:print"5
.Quit"
80 k=inp(2):if k<49 or k>53 then 80
90 if k=53 then ch=6:gosub 470:end els
e if k=52 then 250
100 n=k-48:gosub 280
110 hr=int(rnd(1)*12)+l.mn=0:if n=2 th
en mn=int(rnd(1)+.5)*30:goto 130
120 if n=3 then mn=int(rnd(1)*12)*5
130 gosub 380:amn=mn:ahr=hr:mn=0:h
r=12
140 gosub 340:gosub 420:if k=113 then 30
150 if k<>13 then 140
160 color 2:if amn<>mn or ahr<>hr the
n 190
170 nr=nr+l:gotoxy 26,15:print "Right!":
b=1:c=5:gosub 560
180 nw=0:gosub 240:goto 220
190 gotoxy 26,15:print "Wrong!":b=5:c=1
:gosub 560
200 gosub 240:hr=ahr:mn=amn:nw=nw
+1:if nw<>3 then 130
210 gosub 340:for td=1 to 4000:next:nw=
0:goto 230
220 if nr=5 then nr=0:gosub 500
230 for t=1 to 500:next:goto 110
240 for td=1 to 300:next:sound 1,0:gotox
y 26,15:print " ":return
250 gosub 280
260 gosub 340:gosub 380:gosub 420:if k=1
13 then 30 else 260
270 ' draw the clock
280 clearw 2:color 1
290 ch=6:gosub 470:gotoxy 3,17:print "(H)
ours (Minutes (Q)uit";
300 color 6:ch=16:gosub 470:nr=0:nw=0:
for q=1 to 12:a=q*30+90:gosub 20
310 x=int(x/8):y=int(y/8):if q=11 or q=
12 then x=x-1
320 gotoxy x,y:print q:next
330 xr=xr-7:yr=yr-7:xc=xc+28:yc=yc+
8:mn=0:hr=12:return
340 color 1,1,0:linef xc,yc,omx,omy:linef xc
,yc,ohx,ohy
350 color 1,1,2:a=mn*6+90:gosub 20aine
f xc,yc,x,y:xr=xr/2:yr=yr/2
360 color 1,1,4:omx=x:omy=y:a=hr*30+
90+mn/2:gosub 20:linef xc,yc,x,y
370 xr=xr*2:yr=yr*2:ohx=x:ohy=y:retu
rn
380 color 5:gotoxy 2,15:if hr<10 then prin
t" 11 ;
390 q=hr:gosub 410:print q$;":";:if mn<1
0 then print "0";
400 q=mn:gosub 410:print q$:return
410 q$=right$(str$(q),len(str$(q))-1):return
420 k=inp(2):if k=109 then mn=mn+5:i
f mn=60 then mn=0
430 if k=104 then hr=hr+1
440 if hr =13 then hr =1
450 if k=104 or k=109 or k=13 or k=11
3 then return
460 goto 420
470 poke contrl,12:poke contrl+2,l:pok
e contrl+6,0
480 poke ptsin,0:poke ptsin+2,ch
490 vdisys (0):return
500 restore 520:for nt=1 to 29:read a,b,c
510 sound 1,15,a,b,c*7:next:sound 1,0:retu
rn
520 data 8,5,1,10,5,1,8,5,1,6,5,1,5,5,1,3,5,1,1,5
,5
530 data 5,5,1,8,5,1,10,5,1,8,5,1,6,5,1,5,5,1,3,5
,1,1,5,5
540 data 5,5,1,3,5,2,3,5,1,10,5,3,8,5,2,8,5,1,1,6
,3
550 data 8,5,1,10,5,1,8,5,1,6,5,1,5,5,1,3,5,1,1,5
,6
560 for a=b to c step 2*sgn(c-b):sound 1,1
5,a,6
570 wave 1,1,14,5,5:next:return
Program 6: Hickory, Dickory,
Dock For Amiga
Version by John Krause
CLEAR,30000←
GOSUB init←
loop:←
MENU 1,0,1←
IF MENU(O)=1 THEN ON MENU(1) GOS
UB practice,hours,half,five,quit←
IF p THEN GOSUB SetClock←
GOTO loop←
practice:←
COLOR 3,O:LOCATE 2,17:PRINT " Practi
ce"←
SAY TRANSLATE$("praktis.")←
p=1:hour=0:minute=0:GOSUB Updat
eAnalog ←
HourDigital=0:MinuteDigital=0:GOSU
B UpdateDigital←
RETURN ←
hours: ←
p=0:COLOR 3,O:LOCATE 2,17:PRINT '
' Hours Test "←
SAY TRANSLATE$("hours test.") ←
FOR count= 1 TO 5←
MinuteDigital=0:HourDigital=INT(R
ND*12)-12←
GOSUB GetAnswer←
NEXT←
GOSUB music ←
RETURN←
half:←
p=0:COLOR 3,0:LOCATE 2,17:PRINT "H
alf Hours Test"←
SAY TRANSLATE$("half hours test.") ←
FOR count= 1 TO 5←
MinuteDigital=CINT(RND)*72:HourDi
gital = INT(RND* 12)* 12←
GOSUB GetAnswer←
NEXT←
GOSUB music←
RETURN←
five:←
p=0:COLOR 3,0:LOCATE 2,17:PRINT
" 5 Minute Test"←
SAY TRANSLATE$("five minut test.") ←
FOR count =1 TO 5←
MinuteDigital= INT(RND* 12)* 12: Hour
Digital= INT(RND* 12)* 12←
GOSUB GetAnswer←
NEXT←
GOSUB music←
RETURN←
Speech synthesis and mouse control are
featured in the Amiga version of
"Hickory, Dickory, Dock."
quit: ←
SYSTEM←
SetClock:←
answer=0 ←
IF MOUSE(0)=1 THEN←
IF MOUSE(3)>220 AND MOUSE(3)<29
0 THEN←
IF MOUSE(4)>27 AND MOUSE(4)<36 TH
EN←
GOSUB IncHour←
IF p THEN GOSUB IncHourDigital←
END IF←
IF MOUSE(4)>45 AND MOUSE(4)<54 TH
EN←
GOSUB IncMinute←
IF p THEN GOSUB IncMinuteDigital←
END IF←
IF MOUSE(4)>63 AND MOUSE(4)<72 AN
D p=0 THEN←
COLOR 1,0←
IF INT(hour/12)=HourDigital/12 AN
D minute =MinuteDigital THEN←
LOCATE 10,23:PRINT "Correct!"←
answer=2:SAY TRANSLATE$("corekt.'
')←
ELSE←
LOCATE 10,23:PRINT "Wrong!"←
answer=1:SAY TRANSLATE$("wrong.'
')←
END IF←
FOR i=0 TO 2000:NEXT←
LOCATE 10,23:PRINT SPACE$(9)←
END IF←
END IF←
END IF←
RETURN←
GetAnswer :←
MENU 1,0,0 ←
GOSUB UpdateDigital:wrong=0←
loopl: GOSUB SetClock←
IF answer=0 THEN loopl←
IF answer=2 THEN ←
RETURN←
ELSE←
wrong=wrong+l←
IF wrong<3 THEN←
GOTO loop 1←
ELSE←
WHILE MinuteDigital<>minute:GOSU
B IncMinute:WEND←
WHILE HourDigital/12<>INT(hour/12)
:GOSUB IncHour:WEND←
count=count-1←
FOR t=0 TO 4000:NEXT←
END IF←
END IF←
RETURN←
music: ←
FOR i=0 TO 27: SOUND f(i),t(i):SOUND 0,
1:NEXT:RETURN←
IncHourDigital:←
HourDigital=(O1dHourDigita1+12) MO
D 144←
GOSUB UpdateDigital←
RETURN ←
IncMinuteDigital:←
MinuteDigital=(O1dMinuteDigital+ 12
MOD 144-
HourDigital=(OldHourDigital+l) MO
D 144←
GOSUB UpdateDigital←
RETURN←
IncHour:←
hour=(O1dHour+12) MOD 144←
GOSUB UpdateAnalog←
RETURN←
IncMinute:←
minute=(O1dMinute+12) MOD 144←
hour= (O1dHour+1) MOD 144←
GOSUB UpdateAnalog←
RETURN←
number:←
COLOR 1,2←
LOCATE r(i),c(i) ←
IF i>9 THEN PRINT "l";←
PRINT CHR$(48+(i MOD 10))←
RETURN←
UpdateDigital:←
GOSUB DrawDigital←
O1dHourDigital=HourDigital:OldMinu
teDigital=MinuteDigital←
GOSUB DrawDigital←
RETURN←
DrawDigital:←
IF O1dHourDigital<12 THEN O1dHourDi
gital=0ldHourDigital+ 144←
IF O1dHourDigital> 119 THEN PUT (165,
139),d(0,1)←
PUT (200,139),d(0,(O1dHourDigital\12
MOD 10)←
PUT (245,139),d(O,INT(OldMinuteDigit
al*5/120))←
PUT (280,139),d(O,(O1dMinuteDigital*5
\12) MOD 10)←
RETURN←
C1rAnalog: ←
GOSUB MinuteHand←
COLOR 2:AREAFILL←
GOSUB HourHand←
AREAFILL←
i=CINT(O1dMinute/12):IF i=0 THEN i=
12←
GOSUB number ←
RETURN ←
UpdateAnalog:←
GOSUB C1rAnalog←
O1dMinute=minute:GOSUB MinuteHan
d←
COLOR 1:AREAFILL←
O1dHour=hour:GOSUB HourHand←
AREAFILL←
RETURN←
MinuteHand:←
AREA (cx,cy) ←
AREA (cx+60*x((O1dMinute+143) MO
D 144),cy+60*y((O1dMinute+143) MO
D 144))←
AREA (cx+80*x(O1dMinute MOD 144),c
y+80*y(OldMinute MOD 144))←
AREA (cx+60*x((O1dMinute+l) MO
D 144),cy+60*y((O1dMinute+ 1) MOD 14
4))←
RETURN←
HourHand:←
AREA (cx,cy) ←
AREA (cx+40*x((OldHour+142) MO
D 144),cy+40*y((OldHour+142) MO
D 144))←
AREA (cx+50*x(O1dHour MOD 144),cy
+50*y(O1dHour MOD 144))←
AREA (ex +40*x((O1dHour+2) MOD 144
),cy+40*y((OldHour+2) MoD 144))←
RETURN←
init: ←
SAY " "←
SCREEN 2,320,200,2,1←
WINDOW 2," Hickory, Dickory, Dock "„
2,2←
PALETTE 0,.6,.5,.3←
PALETTE 1,0,0,0 ←
PALETTE 2,.7,.7,.7 ←
PALETTE 3,0,0,0 ←
DIM s(300,6),d(300,9),x(143),y(143),r(1
2),c(12),f(27),t(27)←
MENU 1,0,1,"Test "←
MENU 1, 1, 1, "Practice←
MENU 1,2,1,"Hours ←
MENU 1,3,1,"Half hours" ←
MENU 1,4,1,"5 minute "←
MENU 1,5,1,"Quit "←
MENU 2,0,0,"":MENU 3,0,0,"":MENU 4,
0,0,""←
RANDOMIZE TIMER ←
pi=4*ATN(1):p=1←
FOR i=0 TO 143←
x(i) =COS(pi*(i/72-.5))←
y(i)=SIN(pi*(i/72-.5))*.84←
NEXT←
FOR 1=0 TO 6←
CLS:READ k ←
FOR j=1 TO k:READ x,y:AREA (x,y):NE
XT←
AREAFILL:GET (0,0)-(32,48),s(O,i)←
NEXT←
FOR J=0 TO 9←
CLS:READ a$←
FOR i=1 TO 7 ←
IF MID$(a$,i,l)="1" THEN PUT (O,O),s(
O,i-1)←
NEXT←
GET (0,0)-(32,48),d(Oj)←
NEXT←
CLS:ERASE s←
FOR i=1 TO 12:READ r(i),c(i):NEXT←
FOR i=0 TO 27:READ f(i),t(i):NEXT←
cx=100:cy=85←
CIRCLE (cx,cy),100,1:PAINT (cx,cy),1←
CIRCLE (cx,cy),90,2:PAINT (cx,cy),2←
COLOR 1,2←
FOR i=1 TO 12:GOSUB number:NEXT←
FOR i=0 TO 143 STEP 12←
CIRCLE (cx+84*x(i),cy+84*y(i)),3←
PAINT (cx+84*x(i),cy+84*y(i))←
NEXT←
FOR i=0 TO 69←
dx=COS(pi*(i/30-.5)):dy=SIN(pi*(i/3
0-.5))←
LINE (cx+82*dx,cy+69*dy)-STEP(4*dx,
3*dy)←
NEXT←
LINE (185,135)-(320,200),2,bf←
CIRCLE (236,151),3;PAINT (236,151) ←
CIRCLE (236,171),3:PAINT (236,171)←
GOSUB DrawDigital←
LOCATE 4,23:PRINT " Hours "←
LOCATE 6,23:PRINT "Minutes"←
LOCATE 8,23:PRINT " OK? " ←
SAY TRANSLATE$("welcome to hickor
y dickory dock.")←
GOSUB practice←
RETURN←
DATA 4,0,1,0,21,4,19,4,5 ←
DATA 4,1,0,26,0,22,4,5,4 ←
DATA 4,27,1,27,21,23,19,23,5 ←
DATA 4,27,23,27,43,23,39,23,25 ←
DATA 4,26,44,1,44,5,40,22,40←
DATA 4,0,43,0,23,4,25,4,39←
DATA 6,1,22,6,20,22,20,26,22,21,24,5,2
4←
DATA 1111110,0011000,0110111,0111
101,1011001←
DATA 1101101,1101111,0111000,1111
111,1111101←
DATA 4,14,7,17,10,18,13,17,16,14,17,1
1←
DATA 16,7,13,4,10,3,7,4,4,7,3,10 ←
DATA 783.99,2,783.99,2,783.99,2,880,2
,880,2,880,2,783.99,11←
DATA 783.99,2,659.26,5,659.26,2,698.4
6,5,698.46,2,659.26,11←
DATA 659.26,2,523.25,5,523.25,2,659.2
6,5,659.26,2,587.33,5,587.33,2,880,8←
DATA 783.99,2,880,2,783.99,2,698.46,2
,659.26,2,587.33,2,523.25,11←