home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
UpTime Volume 2 #8
/
utv2n8s2.d64
/
NU
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-28
|
9KB
|
332 lines
1 clr:rem numerator-denominator 1/20/88
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),sh$(4,2)
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 rw=int(rnd(1)*6)+1:rw$=rw$(rw)
310 forl=1to4:v=24:h=1:tx$=" ":gosub3200
330 tx$=chr$(co(l))+rw$+chr$(5):gosub3000:gosub3200:delay=.5:gosub2000:nextl
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$="[206]umerators and [196]enominators"
3765 print"";
3770 h=10
3780 v=3:gosub3200
3785 print"";
3790 print:gosub3500: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)
4071 next i
4080 fori=1to9:forj=1to3:readnu$(i,j):nextj:nexti
4090 forl=1to4:fory=1to2:readsh$(l,y):nexty:nextl
4098 return
4100 rem *** program data ***
4110 data"numerators and denominators"
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
4180 data" [174] "," [221] "," [177][160]"
4190 data"[213][195][201]","[213][195][203]","[173][195][189]"
4200 data"[213][195][201]"," [195][179]","[202][195][203]"
4210 data"[221] [221]","[173][195][179]"," [221]"
4220 data"[176][195][174]","[173][195][201]","[202][195][203]"
4230 data"[213][195][201]","[171][195][201]","[202][195][203]"
4240 data"[176][195][174]"," [221]"," [221]"
4250 data"[213][195][201]","[171][195][179]","[202][195][203]"
4260 data"[213][195][201]","[202][195][179]","[202][195][203]"
4270 data"[206][205]","[205][206]","[207][208]","[204][186]"
4280 data"[206][205]","[204][186]","[186][204]","[208][207]"
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
5027 mx%=20: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
14999 return
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"[204]earn to find the numerator and"
20013 data"denominator of common fractions"
20014 data"with me!"
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. [198]or this option,"
20036 data"you may need pencil and paper."
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 **** see examples done ****
30010 cc$=chr$(159):cw$=chr$(5):cr$=chr$(co(int(rnd(1)*4)+1))
30020 forl=1to2:i(l)=int(rnd(1)*9)+1:nextl
30030 i(3)=i(1):ifi(1)>i(2)theni(3)=i(2)
30040 i(4)=i(2):ifi(1)>i(2)theni(4)=i(1)
30050 i(5)=int(rnd(1)*4)+1
30060 i3$=str$(i(3)):i4$=str$(i(4))
30070 printchr$(142):gosub32000
30080 gosub32000
30100 tx$="look at the fraction:":v=6:h=1:gosub3200
30150 forl=1to3:tx$=nu$(i(3),l):v=9+l:h=30:gosub3200:nextl
30170 tx$="[162][162][162][162][162]":v=14:h=29:gosub3200
30190 forl=1to3:tx$=nu$(i(4),l):v=15+l:h=30:gosub3200:nextl:delay=1:gosub2000
30200 rem ****test for 1 set is/are****
30210 t1$="are":t2$="shapes":ifi(3)=1thent1$="is":t2$="shape"
30230 t3$="are":t4$="parts":ifi(4)=1thent3$="is":t4$="part"
30300 vt=9:h=5