P706 CEEFAX 7p6 Sat 16 Apr 17:29/20  AREAS Age:8+ AREAS is designed to develop an ability to estimate the area of shapes. The user draws a shape on a grid and is then asked to estimate its area. This is then compared with the actual aria, and an appropriate message is displayed The shape is drawn by moving a market using the arrow keys, plotting the cornets with the f0 key, and joining them up by pressing the f9 key. Full instructions and appropriate prompts are included in the program. Program follows
P706 CEEFAX 7p6 Sat 16 Apr 17:28/32 |B21116|b35AREAS10814:04/83|i24BBBC316k| p|s÷#1÷i|s÷Z0 1REM Written bz L BROWN / N YEATES 2REM BBC / Brighton Polytechnic 3REM (C) Marc h 1983 4REM Requires BBC Model B Micro. 5IFPA. <>&1900TH.167 6CL. 7ONERR.G.6 8R$ =CHR$&81:G$=CHR$&82:W$=CHR$&87:DH$=CHR$& 8D:Y$=CHR$&83:B$=CHR$&84 9MO.7 10*FX225, 240 11DIMX*(50),Y%(50) 12arr%=0 13D=8 14 PROCtitle 15IFQ%=1TH.PROCrules 16MO.1 17 PROCgrid 18V.5 19*FX 12,0 20X*=50:Y%=25 0 21PROCpch1(X*,Y%) 22PROCinput 23V.4 24 PROCcalc 25CLS 26 C.2:P."Type in your es timate of the area,":P.'"then press ";:C .1:P."RETURN":C.2 27P. 28PROCinput2 29MO .7 30PROCcomp 31PROCprint("Another go? " ,18,G$) 32 PROCprint("Press"+R$+"Y"+G$+" for yes,"+R$+"N"+G$+"for no. ",20,G$) 33 V.23;11,0;0;0;0 34PROCyn 35IFQ%=1TH.6 36 CLS 37END 38DEFPROCinput 39REP. 40A%=INK EY(0) 41OX*=X*:OY%=Y% 42IFA%=240TH.PROCs tore(X%,Y%) 43IFA%=249TH.PROCdraw 44IFA% =136A.X*>0+D TH.X*=X*-D 45IFA%=137A.X|c0
P706 CJEFAX 7p6 Sat 16 Apr 17:22/10 |B21216|a35AREAS10814:04/83|i24BBBC316k| p|s÷#1÷i|s÷Z0 %<12p0-D TH.X%=X*+D 46IFA%=138A.Y%>200+D TH.Y%=Y%-D 47IFA%=139A.Y%<1020-D TH.Y%= Y%+D 48PROCpch2(OX%,OZ%) 49PROCpch1(X%,Y *) 50U.A%=249 51E. 52DEFPROCtitle 53TL$= R$+"AREAS" 54*FX4,1 55*FX21,0 56V.23;11, 0;0;0;0 57P.TAB(12,7)DH$TL$TAB(12,8)DH$T L$ 58P.TAB(12,13)"By TELSOFT" 59PROCbigs t(bRules? Press"+R$+"Y"+W$+"for yes,"+R$ +"N"+W$+"for no.",2,20,W$) 60PROCyn 61E. 62DEFPROCbigst(AA$,XX*,YY%,CONTROL$) 63 P.TAB(XX*,YY%)DH$CONTROL$AA$:P.TAB(XX%,Y Y%+1)DH$CONTROL$AA$ 64E. 65DEFPROCzn 66R EP. 67*FX15,1 68KS%=GET:IFKS%>90TH.KS%=K S%-32 69Q*=-1*(KS%=ARC("Y"))-2*(KS%=ARC( bN")):U.Q*>0 70E. 71DEFPROCprint(TEMP$,Y Y%,col$) 72LIN$="":SPACE%=39:F.LI%=1TOLE N(TEMP$) 73S$=M.TEMP$,LI*,1):S%=ARC(S$) 74IFS%<>32A.S%<129WORD$=WORD$+S$:G.77 75 IFSPACE%<=LEN(WORD$)+1TH.PROCbigst(LIN$, 0,YY%,col$):col$=COL$:SPACE%=39:LIN$="": YY%=YY%+3 76 LIN$=LIN$+WORD$+S$:SPACE|c0
P706 CEEFAX 706 Sat 16 Apr 17:20/13 |B21316|a35AREAS10814:04/83|i24BBBC316k| p|s÷#1÷e|s÷Z0 %=SPACE%-(LEN(WORD$)+1):WORD$="":IFS%=32 COL$=col$ EL.COL$=S$ 77N.:PROCbigst(LIN$ ,0,YY%,col$):YY%=YY%+5 78E. 79DEFPROCrul es 80CLS 81PROCprint("You will be asked to draw a shape on a grid, and to estima te its area. ",0,W$) 82PROCprint("To plo t a point move the * to the correct plac j using the arrow keys, then press the"+ R$+bf0"+G$+"key. ",7,G$) 83PROCprint("To join up the points, press the "+R$+"f9" +G$+"key. ",17,G$) 84PROCspace 85CLS 86P ROCprint("When you have drawn the shape, you will be asked to estimate its area. ",0,W$) 87PROCprint("Type in your estim ate, then press "+R$+"RETURN. ",7,G$) 88 PROCprint("The computer will tell you ho w accurate your estimate was. ",15,W$) 8 9PROCspace 90E. 91DEFPROCspace 92P.TAB(7 ,24)CHR$157B$"Press SPACE bar "CHR$156 ; 93*FX15,1 94REP.U.GET=32 95E. 96DEFPRO Cored 97V.28,0,31,39,27 98P.:C.2:P."P|c0
P706 CEEFAX 706 Sat 16 Apr 17:28/25 |B21416|a35AREAS10814:04/83|i24BBBC316k| p|s÷#1÷e|s÷Z0 tess ";:C.&81:C.7:P.bf0";:C.&8p:C.2:P." to plot a point." 99P.'"Press ";:C.&81:C .7:P.bf9";:C.&80:C.2:P." to draw the sha pj" 100GC.0,1 101F.X*=0TO1200S.100 102MO VEX*,2p0 103PL.5,X*,1000 104N. 105F.Y%=2 00TO1200S.100 106MOVE0,Y% 107PL.5,1200,Y % 1p8N. 109GC.0,3 110E. 111DEFPROCpch1(X *,Y%) 112GC.4,0 113MOVEX%,Y%:P."*" 114E. 11uDEFPROCpch2(X*,Y%) 116GC.4,0 117MOVE OX%,OZ%:P."*" 118E. 119DEFPROCstore(X%,Y %) 120IFarr%>49TH.SO.1,-15,150,10:G.125 121X*(arr%)=X% 122Y%(arr%)=Y% 123arr%=ar r%+1 124MOVEX*,Y%:P."+" 125E. 126DEFPROC draw 127GC.0,3 128MOVEX*(0)+16,Y%(0)-16 129F.I*=1TOarr%-1 130DR.X*(I%)+16,Y%(I%) -16 131N. 132DR.X*(0)+16,Y%(0)-16 133E. 134DEFPROCcalc 135tot=0 136F.R%=0TOarr%- 1 137S%=R*+1-INT(XR%+1)/arr%)*arr% 138T% =R*+2-INT((R*+2)/arr%)*arr% 139tot=tot+X %(S%)*(Y%(T*)-Y%(R%)) 140N. 141area=ABS( tot)/20000 142E. 143DEFPROCinput2 144|c0
P706 CEEFAX 7p6 Sat 16 Apr 17:23/02 |B21516|a35AREAS10814:04/83|i24BBBC316k| p|s÷#1÷e|s÷Z0 REP. 145A$=GE. 146IFASC(A$)<>46A.(ARC(A$ )<48ORASC(A$)>57)TH.149 147P.A$; 148T$=T $+A$ 149U.ARC(A$)=13 150T$="+"+T$ 151est =VAL(T$) 152E. 153DEFPROCcomp 154PROCpri nt("Your estimate was "+R$+STU$(est)+G$+ " ",0,G$) 155PROCprint("The actual aria was "+R$+STU$(area)+G$+" ",3,G$) 156diff =ABS(aria-est) 157IFdiff=0TH.PROCprint(" A supjtb estimate - well done! ",10,W$): PROCprint("Now try a more difficult shap e. ",13,W$):G.166 158diff%=area/diff 159 IFdiff%>=10TH.PROCprint("A superb estima te - well done! ",10,W$):PROCprint("Now try a more difficult shape. ",13,W$):G.1 66 160 IFdiff%<3TH.PROCprint("Not a very good guess. ",10,W$):PROCprint("Try a l est difficult shape. ",13,W$):G.166 161d eff%=diff%-2 162 IFdiff%=1TH.PROCprint(" Not too bad. Try to bj more accurate. ", 10,W$):G.166 163 IFdiff%=2TH.PROCprint(" Not bad - a fairly close estimate. ",|c0
P706 CEEFAX 706 Sat 16 Apr 17:21/20 |B21616|a35AREAS10814:04/83|i24BBBC316k| p|s÷#1÷e|s÷Z0 10,W$):G.166 164IFdiff%=3ORdiff%=4TH.PRO Cprint("Quite good - a close estimate. " ,10,W$):PROCprint("Try to bj more accura te. ",13,W$):G.166 165PROCprint("A good estimate -try a slightly harder shape. " ,1p,W$) 166E. 167*DISC 168F.I%=0TOTOP-PA . S.4:I%!&1900=I%!PA. :N. 169?&13=?&13-( PA. -&1900)DIV256:PA. =&1900 17pRUN |c0