home *** CD-ROM | disk | FTP | other *** search
- 1 rem **** reducing fractions 1/20/88
- 5 clr
- 10 poke53280,0:poke53281,0
- 15 a1=1
- 17 c1$="[164][157]" : c2$=" [157]" : c%=0 : i$="" : no% = 0
- 20 dims(9),s$(11),se$(11),nu$(10,3)
- 100 gosub4000:printchr$(14)
- 105 gosub10000
- 110 gosub3700
- 120 h=0:v=10:tx$="[196]o you need a lesson? "
- 130 gosub3200
- 140 lo=0:gosub2100:printa$
- 150 ifa$="y"ora$="[217]"thengosub20000:goto 160
- 151 if a$="n" or a$="[206]" then 160
- 152 goto 120
- 160 gosub5000
- 165 ru=1
- 170 gosub1000
- 172 print chr$ (14):gosub 3700:ifop<>3then191
- 174 gosub3700
- 176 gosub500
- 190 gosub 3700
- 191 h=0:v=10:tx$="[196]o you want to play again? "
- 200 gosub3200
- 210 lo=0:gosub2100:printa$
- 220 ifa$="y"ora$="[217]"then160
- 221 if a$="n" or a$="[206]" then 230
- 222 goto 191
- 230 clr:poke53269,0:load"menu",8
- 240 stop
- 300 rem **** rewards ****
- 310 rw=int(rnd(1)*6)+1:rw$=rw$(rw)
- 320 forl=1to4:v=24:gosub3900:delay=.3:gosub2000
- 330 tx$=chr$(co(l))+rw$+chr$(5):gosub3000:gosub3200:delay=.3:gosub2000:next l
- 340 return
- 500 v=10:h=0:tx$="[217]ou got"+str$(np-mi)+" right out of"+str$(np)+" problems"
- 501 print chr$(14)
- 510 gosub3200
- 540 v=12:tx$="for "+str$(int(((np-mi)/np)*100))+"%."
- 545 gosub3200
- 550 delay=7:gosub2000
- 560 return
- 1000 rem *** central routine ***
- 1005 hp=0:mi=0
- 1007 print"[147]"
- 1010 fori=1tonp
- 1030 gosub3600
- 1040 gosub30000
- 1066 v=24:tx$=" <return> to continue, <_> to exit[146]"
- 1067 gosub3000:gosub3200
- 1068 lo=0:gosub2100
- 1069 ifa$="_"then sa=i:i=np
- 1070 next i: if sa<>0 then np=sa
- 1080 return
- 2000 rem *** timer ***
- 2010 ti$="000000"
- 2015 geta$:ifa$<>""then2030
- 2020 ifti/60<delaythen2015
- 2030 return
- 2100 rem *** get character ***
- 2110 geta$:ifa$=""then2110
- 2120 a=val(a$):ifa<loora>hithen2110
- 2130 return
- 2499 rem **** remove leading spaces ****
- 2500 l=len(sp$):ifleft$(sp$,1)<>" "thengoto2520
- 2510 l=l-1:sp$=right$(sp$,l)
- 2520 return
- 3000 rem *** center text ***
- 3010 ln=len(tx$)
- 3020 h=(40-ln)/2
- 3030 return
- 3100 v=24:tx$=" <[210][197][212][213][210][206]> to continue[146]"
- 3110 gosub3000:gosub3200
- 3120 lo=0:gosub2100
- 3130 ifa$<>chr$(13) then 3100
- 3140 return
- 3200 rem *** hor/ver tab ***
- 3210 vt$="":forq=1tov
- 3220 :vt$=vt$+""
- 3230 nextq
- 3240 print"";vt$;
- 3250 printtab(h);tx$;
- 3260 return
- 3500 rem *** line across screen ***
- 3510 print"";
- 3520 forq=1to40
- 3530 :print"[192]";
- 3540 nextq
- 3575 print"";
- 3580 return
- 3600 rem *** print screen header ***
- 3610 print"[147]"
- 3630 tx$="vision software presents:"
- 3640 h=10
- 3650 v=1:gosub3200
- 3660 tx$=t$
- 3665 print"";
- 3670 h=10
- 3680 v=3:gosub3200
- 3685 print"";
- 3690 print:gosub3500:return
- 3700 rem *** print screen header ***
- 3710 print"[147]"
- 3740 h=10:tx$="[214][201][211][201][207][206][160][211][207][198][212][215][193][210][197] presents:"
- 3750 v=1:gosub3200
- 3760 tx$="[210]educing [198]ractions"
- 3765 print"";
- 3770 h=10
- 3780 v=3:gosub3200
- 3785 print"";
- 3790 print:gosub3500:return
- 3900 rem **** blank a line ****
- 3910 tx$=" ":h=0:gosub3200:return
- 4000 rem *** read data ***
- 4005 readt$
- 4010 fori=1to6
- 4020 :readrw$(i)
- 4030 nexti
- 4040 fori=1to3
- 4050 :readop$(i)
- 4060 nexti
- 4070 for i=1 to 4: read co(i):nexti
- 4080 fori=0to9:forl=1to3:readnu$(i,l):nextl:nexti
- 4090 forl=1to4:readsh$(l):nextl
- 4098 return
- 4100 rem *** program data ***
- 4110 data"reducing fractions"
- 4120 data"great!","fantastic!","super!"
- 4130 data"you're really going now!","yes! yes! yes!","that's great!"
- 4140 data"[211]ee examples done."
- 4150 data"[196]o problems with help."
- 4160 data"[196]o problems yourself."
- 4170 data 30,28,31,158
- 4200 data"[213][195][201]","[221] [221]","[202][195][203]"
- 4210 data" [174] "," [221] "," [177] "
- 4220 data"[213][195][201]","[213][195][203]","[173][195][189]"
- 4230 data"[213][195][201]"," [195][179]","[202][195][203]"
- 4240 data"[176] [176]","[173][195][179]"," [177]"
- 4250 data"[176][195][174]","[173][195][201]","[202][195][203]"
- 4260 data"[213][195][201]","[171][195][201]","[202][195][203]"
- 4270 data"[176][195][174]"," [221]"," [177]"
- 4280 data"[213][195][201]","[171][195][179]","[202][195][203]"
- 4290 data"[213][195][201]","[202][195][179]","[202][195][203]"
- 4300 data"[193]","[211]","[218]","[216]"
- 5000 rem *** setup for math ***
- 5001 ifru=1then5030
- 5005 tx$=" ":v=10:h=0:gosub3200
- 5010 ifru=1then5037
- 5015 tx$=" ":v=10:h=0:gosub3200
- 5020 h=0:v=7:tx$="[215]hat's your first name? ":gosub3200
- 5022 mx%=20:i$="":gosub60000:nf$=i$:ifnf$=""then5020
- 5025 h=0:v=9:tx$="[215]hat's your last name? ":gosub3200:i$="":gosub60000:nl$=i$
- 5030 v=12:h=0:tx$="[215]ould you like to: ":gosub3200
- 5040 h=7:v=14:fori=1to3
- 5050 :tx$=str$(i)+". "+op$(i):gosub3200
- 5080 v=v+1:nexti
- 5090 v=18:h=0:tx$="[217]our choice? (1-3) "
- 5100 gosub3200
- 5110 lo=1:hi=3:gosub2100:printa$
- 5120 op=a:hi=20
- 5130 ifop=1thenhi=5
- 5150 v=21:h=0:tx$="[200]ow many problems do you want"
- 5160 gosub3200
- 5170 v=22:tx$="to do? (1 -"+str$(hi)+") [157][157]"
- 5180 gosub3200
- 5190 mx%=2:no%=1:i$="":gosub60000:np=val(i$)
- 5200 ifnp<loornp>hithen np=0 :goto5170
- 5390 return
- 10000 rem *** do spritey things ***
- 10001 for i=704 to 767
- 10002 readx:pokei,x
- 10003 next
- 10004 poke2040,11
- 10005 poke53269,peek(53269)or1
- 10006 poke53287,2:poke53277,255:poke53271,255
- 10007 poke53248,30:poke53249,58
- 10008 return
- 10009 data252,252,252,121,249,248,51,243,240
- 10010 data7,231,224,15,207,192,7,159,128
- 10011 data3,63,0,0,126,0,0,252,0
- 10012 data0,120,0,0,48,0,0,0,0
- 10013 data0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
- 20000 rem *** info info info ***
- 20001 gosub3700:v=6
- 20002 readn
- 20003 fori=1ton
- 20004 :readtx$
- 20005 :iftx$="page"thengosub 3100:gosub 3700:v=6 :goto20009
- 20006 :h=2:ifmid$(tx$,10,1)="[163]"thenv=v+1:gosub3200:goto20008
- 20007 :v=v+2:gosub3200
- 20008 :delay=.5:gosub2000
- 20009 nexti:n=0:return
- 20011 data35
- 20012 data"[211]ee how fractions can be reduced"
- 20013 data"to the lowest terms with this"
- 20014 data"program."
- 20015 data"[212]here are three ways to use the"
- 20016 data"program:"," 1) [211]ee examples done"
- 20017 data" 2) [196]o problems with help"
- 20018 data" 3) [196]o problems yourself"
- 20019 data"page"
- 20020 data" 1) [211]ee examples done"
- 20021 data" [163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
- 20022 data"[201]f you want to see examples done,"
- 20023 data"[201] will show you how to do them,"
- 20024 data"explaining each step as [201] go."
- 20025 data"page"
- 20026 data" 2) [196]o problems with help"
- 20027 data" [163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
- 20028 data"[212]o do problems with help, [201] will"
- 20029 data"give you a hint for each step,"
- 20030 data"and help you if you make mistakes."
- 20031 data"page"
- 20032 data" 3) [196]o problems yourself"
- 20033 data" [163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
- 20034 data"[212]he third option is to work problems"
- 20035 data"on your own. "
- 20036 data""
- 20037 data"page"
- 20038 data" [206]umber of [208]roblems"
- 20039 data" [163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
- 20040 data"[204]ast, you decide how many problems"
- 20041 data"to do. [201]f you let the computer do"
- 20042 data"the work, you may only have 5"
- 20043 data"problems; otherwise you may have"
- 20044 data"from 1 to 20 problems."
- 20045 data"page"
- 30000 rem **** op 1 ****
- 30010 cc$=chr$(159):cw$=chr$(5)
- 30020 forl=1to2:i(l)=int(rnd(1)*9)+1:nextl:i(3)=int(rnd(1)*3)+2
- 30030 ifi(2)<=i(1)thengoto30020
- 30031 forl=2toi(1):ifint(i(1)/l)<>i(1)/lthen30033
- 30032 ifint(i(2)/l)=i(2)/lthen30020
- 30033 nextl
- 30040 i(4)=i(1)*i(3):i(5)=i(2)*i(3):sh$=sh$(int(rnd(1)*4)+1)
- 30050 forl=1to2:cr$(l)=chr$(co(int(rnd(1)*4)+1)):nextl:ifcr$(1)=cr$(2)then30050
- 30060 i3$=str$(i(3)):i1$=str$(i(1)):i2$=str$(i(2))
- 30061 sp$=i3$:gosub2500:i3$=sp$:sp$=i1$:gosub2500:i1$=sp$
- 30062 sp$=i2$:gosub2500:i2$=sp$
- 30070 printchr$(142):gosub32000
- 30080 onopgoto30100,30500,30800
- 30100 vp=9:hp=30:ifi(4)<10thenhp=hp+2
- 30110 cl$=cr$(1):pn=i(4):gosub32100
- 30120 tx$="[162][162][162][162][162][162][162][162]":v=13:h=30:gosub3200
- 30130 vp=15:hp=30:ifi(5)<10thenhp=hp+2
- 30140 cl$=cr$(2):pn=i(5):gosub32100
- 30180 tx$="divide both by the same number.":v=6:h=1:gosub3200:delay=2:gosub2000
- 30190 tx$="they can both be divided by "+i3$+".":v=21:h=1:gosub3200
- 30200 delay=2:gosub2000
- 30210 h1=5:h2=h1+i(3)-1:hs=1:v1=9:v2=v1+i(1)-1:vs=1
- 30220 tx$=cr$(1)+sh$+cw$:gosub32300
- 30250 h1=11:h2=11:hs=1:v1=9:v2=v1+i(2)-1:vs=1
- 30260 v=9:h=10:forl=1toi(2):tx$=str$(l):gosub3200:v=v+1:nextl
- 30280 h1=14:h2=h1+i(3)-1:hs=1:v1=9:v2=v1+i(2)-1:vs=1
- 30290 tx$=cr$(2)+sh$+cw$:gosub32300:delay=2:gosub2000
- 30310 forv=8to11:tx$=" ":h=29:gosub3200:nextv
- 30320 forv=14to18:tx$=" ":h=29:gosub3200:nextv
- 30350 vp=9:hp=30:ifi(1)<10thenhp=hp+2
- 30360 cl$=cr$(1):pn=i(1):gosub32100
- 30370 tx$="[162][162][162][162][162][162][162][162]":v=13:h=30:gosub3200
- 30380 vp=15:hp=30:ifi(2)<10thenhp=hp+2
- 30390 cl$=cr$(2):pn=i(2):gosub32100
- 30400 return
- 30500 rem **** op 2 ****
- 30510 tx$="reduce the fraction:":v=6:h=1:gosub3200:delay=1:gosub2000
- 30520 vp=9:hp=30:ifi(4)<10thenhp=hp+2
- 30530 cl$=cr$(1):pn=i(4):gosub32100
- 30540 tx$="[162][162][162][162][162][162][162][162]":v=13:h=30:gosub3200
- 30550 vp=15:hp=30:ifi(5)<10thenhp=hp+2
- 30560 cl$=cr$(2):pn=i(5):gosub32100
- 30561 h1=5:h2=h1+i(3)-1:hs=1:v1=9:v2=v1+i(1)-1:vs=1
- 30562 tx$=cr$(1)+sh$+cw$:gosub32300
- 30563 h1=14:h2=h1+i(3)-1:hs=1:v1=9:v2=v1+i(2)-1:vs=1
- 30564 tx$=cr$(2)+sh$+cw$:gosub32300:delay=1:gosub2000
- 30570 tx$="divide both by the same number.":v=6:h=1:gosub3200:delay=.5:gosub2000
- 30580 tx$="what number can you divide by? ":v=20:h=1:gosub3200
- 30585 mx%=20:no%=1:i$="":gosub60000:aa$=i$
- 30590 ifaa$=i3$thengosub300:gosub3900:goto30610
- 30600 tx$="both numbers can be divided by "+i3$+".":v=20:h=1:gosub3200
- 30610 delay=2:gosub2000:v=20:gosub3900
- 30620 tx$="the numerator is ? ":v=20:h=1:gosub3200
- 30625 mx%=20:no%=1:i$="":gosub60000:aa$=i$
- 30630 ifaa$=i1$thengosub300:v=24:gosub3900:goto30650
- 30640 v=20:gosub3900:tx$="the numerator is "+i1$+".":v=20:h=1:gosub3200
- 30650 forv=8to11:tx$=" ":h=29:gosub3200:nextv
- 30670 vp=9:hp=30:ifi(1)<10thenhp=hp+2
- 30680 cl$=cw$:pn=i(1):gosub32100
- 30700 delay=2:gosub2000:v=20:gosub3900
- 30710 tx$="the denominator is ? ":v=20:h=1:gosub3200
- 30715 mx%=20:no%=1:i$="":gosub60000:aa$=i$
- 30720 ifaa$=i2$thengosub300:v=24:gosub3900:goto30740
- 30730 v=20:gosub3900:tx$="the denominator is "+i2$+".":v=20:h=1:gosub3200
- 30740 forv=14to18:tx$=" ":h=29:gosub3200:nextv
- 30750 vp=15:hp=30:ifi(2)<10thenhp=hp+2
- 30760 cl$=cw$:pn=i(2):gosub32100
- 30790 return
- 30800 rem **** op 3 ****
- 30810 tx$="reduce the fraction:":v=6:h=1:gosub3200
- 30820 vp=9:hp=30:ifi(4)<10thenhp=hp+2
- 30830 cl$=cr$(1):pn=i(4):gosub32100
- 30840 tx$="[162][162][162][162][162][162][162][162]":v=13:h=30:gosub3200
- 30850 vp=15:hp=30:ifi(5)<10thenhp=hp+2
- 30860 cl$=cr$(2):pn=i(5):gosub32100
- 30870 tx$="the numerator is ? ":v=20:h=1:gosub3200
- 30875 mx%=20:no%=1:i$="":gosub60000:aa$=i$
- 30880 tx$="the denominator is ? ":v=22:h=1:gosub3200
- 30885 no%=1:i$="":gosub60000:ab$=i$
- 30890 ifaa$=i1$andab$=i2$thengosub300:v=24:gosub3900:goto30930
- 30900 forv=20to23:gosub3900:nextv
- 30910 v=20:gosub3900:mi=mi+1:tx$="let me show you this one.":v=20:h=0:gosub3200
- 30920 delay=1:gosub2000:v=20:gosub3900:goto30180
- 30930 forv=8to11:tx$=" ":h=29:gosub3200:nextv
- 30940 vp=9:hp=30:ifi(1)<10thenhp=hp+2
- 30950 cl$=cw$:pn=i(1):gosub32100
- 30960 forv=14to18:tx$=" ":h=29:gosub3200:nextv
- 30970 vp=15:hp=30:ifi(2)<10thenhp=hp+2
- 30980 cl$=cw$:pn=i(2):gosub32100
- 31000 return
- 32000 rem ***** draw box *****
- 32010 tx$=cc$+"[182][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][181]":v=8:h=3:gosub3200
- 32020 forl=1to9:tx$="[182] [181]":v=v+1:gosub3200:nextl
- 32030 tx$="[182][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][181]"+cw$:v=v+1:gosub3200:return
- 32100 rem **** draw large number ****
- 32110 ifpn<=9thengoto32160
- 32120 pn$=str$(pn):sp$=pn$:gosub2500:pn$=sp$:pn=val(left$(pn$,1))
- 32130 v=vp:h=hp:forl=1to3:tx$=cl$+nu$(pn,l)+cw$:gosub3200:v=v+1:nextl
- 32140 h=h+4:v=vp:pn=val(right$(pn$,1)):forl=1to3:tx$=cl$+nu$(pn,l)+cw$
- 32150 gosub3200:v=v+1:nextl:return
- 32160 v=vp:h=hp:for l=1to3:tx$=cl$+nu$(pn,l)+cw$:gosub3200:v=v+1:nextl
- 32200 return
- 32300 rem **** print matrix ****
- 32310 forh=h1toh2stephs:forv=v1tov2stepvs
- 32320 gosub3200:nextv:nexth
- 32400 return
- 60000 :
- 60010 : rem input routine
- 60020 :
- 60030 l%=len(i$) : c%=0
- 60040 print i$; c1$; : poke 198,0
- 60050 :
- 60060 get g$
- 60070 if g$="" then c%=c%+1 : if c%>20 then print c1$; : c%=0 : goto 60060
- 60080 if g$="" then if c%>10 then print c2$; : goto 60060
- 60090 if g$="" then 60060
- 60100 :
- 60110 : rem return key
- 60120 :
- 60125 if g$<>chr$(13) then 60150
- 60130 if no%=1 then no%=0
- 60140 print " " : return
- 60150 :
- 60160 : rem del key
- 60170 :
- 60180 if g$<>chr$(20) then 60230
- 60190 if l%=0 then 60060
- 60200 print"[157] [157][157]";c1$;
- 60210 l% = l%-1 : i$=left$(i$,l%)
- 60220 goto 60060
- 60230 :
- 60240 : rem add a key
- 60250 :
- 60260 if l%>=mx% then 60060
- 60262 if no%=0 then 60270
- 60263 if (g$<"0" or g$>"9") and g$<>"." and g$<>"-" then 60060
- 60264 goto 60290
- 60270 if (g$<" " or g$>"[218]") then 60060
- 60280 if (g$>"_" and g$<"[193]") then 60060
- 60290 i$=i$+g$ : l%=l%+1
- 60300 print g$; c1$; : c%=0
- 60310 goto 60060
- 60320 :
-