home *** CD-ROM | disk | FTP | other *** search
/ UpTime Volume 2 #8 / utv2n8s2.d64 / NU (.txt) < prev    next >
Encoding:
Commodore BASIC  |  1988-01-01  |  8.6 KB  |  332 lines

  1. 1 clr:rem numerator-denominator 1/20/88
  2. 10 poke53280,0:poke53281,0
  3. 15 a1=1
  4. 17 c1$="[164][157]" : c2$=" [157]" : c%=0 : i$="" : no% = 0
  5. 20 dims(9),s$(11),se$(11),nu$(10,3),sh$(4,2)
  6. 100 gosub4000:printchr$(14)
  7. 105 gosub10000
  8. 110 gosub3700
  9. 120 h=0:v=10:tx$="[196]o you need a lesson? "
  10. 130 gosub3200
  11. 140 lo=0:gosub2100:printa$
  12. 150 ifa$="y"ora$="[217]"thengosub20000:goto 160
  13. 151 if a$="n" or a$="[206]" then 160
  14. 152 goto 120
  15. 160 gosub5000
  16. 165 ru=1
  17. 170 gosub1000
  18. 172 print chr$  (14):gosub 3700:ifop<>3then191
  19. 174 gosub3700
  20. 176 gosub500
  21. 190 gosub 3700
  22. 191 h=0:v=10:tx$="[196]o you want to play again? "
  23. 200 gosub3200
  24. 210 lo=0:gosub2100:printa$
  25. 220 ifa$="y"ora$="[217]"then160
  26. 221 if a$="n" or a$="[206]" then 230
  27. 222 goto 191
  28. 230 clr:poke53269,0:load"menu",8
  29. 240 stop
  30. 300 rw=int(rnd(1)*6)+1:rw$=rw$(rw)
  31. 310 forl=1to4:v=24:h=1:tx$="                                   ":gosub3200
  32. 330 tx$=chr$(co(l))+rw$+chr$(5):gosub3000:gosub3200:delay=.5:gosub2000:nextl
  33. 340 return
  34. 500 v=10:h=0:tx$="[217]ou got"+str$(np-mi)+" right out of"+str$(np)+" problems"
  35. 501 print chr$(14)
  36. 510 gosub3200
  37. 540 v=12:tx$="for "+str$(int(((np-mi)/np)*100))+"%."
  38. 545 gosub3200
  39. 550 delay=7:gosub2000
  40. 560 return
  41. 1000 rem *** central routine ***
  42. 1005 hp=0:mi=0
  43. 1007 print"[147]"
  44. 1010 fori=1tonp
  45. 1030 gosub3600
  46. 1040 gosub30000
  47. 1066 v=24:tx$="   <return> to continue, <_> to exit[146]"
  48. 1067 gosub3000:gosub3200
  49. 1068 lo=0:gosub2100
  50. 1069 ifa$="_"then sa=i:i=np
  51. 1070 next i: if sa<>0 then np=sa
  52. 1080 return
  53. 2000 rem *** timer ***
  54. 2010 ti$="000000"
  55. 2015 geta$:ifa$<>""then2030
  56. 2020 ifti/60<delaythen2015
  57. 2030 return
  58. 2100 rem *** get character ***
  59. 2110 geta$:ifa$=""then2110
  60. 2120 a=val(a$):ifa<loora>hithen2110
  61. 2130 return
  62. 2499 rem **** remove leading spaces ****
  63. 2500 l=len(sp$):ifleft$(sp$,1)<>" "thengoto2520
  64. 2510 l=l-1:sp$=right$(sp$,l)
  65. 2520 return
  66. 3000 rem *** center text ***
  67. 3010 ln=len(tx$)
  68. 3020 h=(40-ln)/2
  69. 3030 return
  70. 3100 v=24:tx$="   <[210][197][212][213][210][206]> to continue[146]"
  71. 3110 gosub3000:gosub3200
  72. 3120 lo=0:gosub2100
  73. 3130 ifa$<>chr$(13) then 3100
  74. 3140 return
  75. 3200 rem *** hor/ver tab ***
  76. 3210 vt$="":forq=1tov
  77. 3220 :vt$=vt$+""
  78. 3230 nextq
  79. 3240 print"";vt$;
  80. 3250 printtab(h);tx$;
  81. 3260 return
  82. 3500 rem *** line across screen ***
  83. 3510 print"";
  84. 3520 forq=1to40
  85. 3530 :print"[192]";
  86. 3540 nextq
  87. 3575 print"";
  88. 3580 return
  89. 3600 rem *** print screen header ***
  90. 3610 print"[147]"
  91. 3630 tx$="vision software presents:"
  92. 3640 h=10
  93. 3650 v=1:gosub3200
  94. 3660 tx$=t$
  95. 3665 print"";
  96. 3670 h=10
  97. 3680 v=3:gosub3200
  98. 3685 print"";
  99. 3690 print:gosub3500:return
  100. 3700 rem *** print screen header ***
  101. 3710 print"[147]"
  102. 3740 h=10:tx$="[214][201][211][201][207][206][160][211][207][198][212][215][193][210][197] presents:"
  103. 3750 v=1:gosub3200
  104. 3760 tx$="[206]umerators and [196]enominators"
  105. 3765 print"";
  106. 3770 h=10
  107. 3780 v=3:gosub3200
  108. 3785 print"";
  109. 3790 print:gosub3500:return
  110. 4000 rem *** read data ***
  111. 4005 readt$
  112. 4010 fori=1to6
  113. 4020 :readrw$(i)
  114. 4030 nexti
  115. 4040 fori=1to3
  116. 4050 :readop$(i)
  117. 4060 nexti
  118. 4070 for i=1 to 4: read co(i)
  119. 4071 next i
  120. 4080 fori=1to9:forj=1to3:readnu$(i,j):nextj:nexti
  121. 4090 forl=1to4:fory=1to2:readsh$(l,y):nexty:nextl
  122. 4098 return
  123. 4100 rem *** program data ***
  124. 4110 data"numerators and denominators"
  125. 4120 data"great!","fantastic!","super!"
  126. 4130 data"you're really going now!","yes!  yes!  yes!","that's great!"
  127. 4140 data"[211]ee examples done."
  128. 4150 data"[196]o problems with help."
  129. 4160 data"[196]o problems yourself."
  130. 4170 data 30,28,31,158
  131. 4180 data" [174] "," [221] "," [177][160]"
  132. 4190 data"[213][195][201]","[213][195][203]","[173][195][189]"
  133. 4200 data"[213][195][201]"," [195][179]","[202][195][203]"
  134. 4210 data"[221] [221]","[173][195][179]","  [221]"
  135. 4220 data"[176][195][174]","[173][195][201]","[202][195][203]"
  136. 4230 data"[213][195][201]","[171][195][201]","[202][195][203]"
  137. 4240 data"[176][195][174]","  [221]","  [221]"
  138. 4250 data"[213][195][201]","[171][195][179]","[202][195][203]"
  139. 4260 data"[213][195][201]","[202][195][179]","[202][195][203]"
  140. 4270 data"[206][205]","[205][206]","[207][208]","[204][186]"
  141. 4280 data"[206][205]","[204][186]","[186][204]","[208][207]"
  142. 5000 rem *** setup for math ***
  143. 5001 ifru=1then5030
  144. 5005 tx$="                                    ":v=10:h=0:gosub3200
  145. 5010 ifru=1then5037
  146. 5015 tx$="                                    ":v=10:h=0:gosub3200
  147. 5020 h=0:v=7:tx$="[215]hat's your first name? ":gosub3200
  148. 5022 mx%=20:i$="":gosub60000:nf$=i$:ifnf$=""then5020
  149. 5025 h=0:v=9:tx$="[215]hat's your last name? ":gosub3200
  150. 5027 mx%=20:i$="":gosub60000:nl$=i$
  151. 5030 v=12:h=0:tx$="[215]ould you like to:                     ":gosub3200
  152. 5040 h=7:v=14:fori=1to3
  153. 5050 :tx$=str$(i)+". "+op$(i):gosub3200
  154. 5080 v=v+1:nexti
  155. 5090 v=18:h=0:tx$="[217]our choice? (1-3) "
  156. 5100 gosub3200
  157. 5110 lo=1:hi=3:gosub2100:printa$
  158. 5120 op=a:hi=20
  159. 5130 ifop=1thenhi=5
  160. 5150 v=21:h=0:tx$="[200]ow many problems do you want"
  161. 5160 gosub3200
  162. 5170 v=22:tx$="to do? (1 -"+str$(hi)+")   [157][157]"
  163. 5180 gosub3200
  164. 5190 mx%=2:no%=1:i$="":gosub60000:np=val(i$)
  165. 5200 ifnp<loornp>hithen np=0 :goto5170
  166. 5390 return
  167. 10000 rem *** do spritey things ***
  168. 10001 for i=704 to 767
  169. 10002 readx:pokei,x
  170. 10003 next
  171. 10004 poke2040,11
  172. 10005 poke53269,peek(53269)or1
  173. 10006 poke53287,2:poke53277,255:poke53271,255
  174. 10007 poke53248,30:poke53249,58
  175. 10008 return
  176. 10009 data252,252,252,121,249,248,51,243,240
  177. 10010 data7,231,224,15,207,192,7,159,128
  178. 10011 data3,63,0,0,126,0,0,252,0
  179. 10012 data0,120,0,0,48,0,0,0,0
  180. 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
  181. 14999 return
  182. 20000 rem *** info info info ***
  183. 20001 gosub3700:v=6
  184. 20002 readn
  185. 20003 fori=1ton
  186. 20004 :readtx$
  187. 20005 :iftx$="page"thengosub 3100:gosub 3700:v=6 :goto20009
  188. 20006 :h=2:ifmid$(tx$,10,1)="[163]"thenv=v+1:gosub3200:goto20008
  189. 20007 :v=v+2:gosub3200
  190. 20008 :delay=.5:gosub2000
  191. 20009 nexti:n=0:return
  192. 20011 data35
  193. 20012 data"[204]earn to find the numerator and"
  194. 20013 data"denominator of common fractions"
  195. 20014 data"with me!"
  196. 20015 data"[212]here are three ways to use the"
  197. 20016 data"program:","    1) [211]ee examples done"
  198. 20017 data"    2) [196]o problems with help"
  199. 20018 data"    3) [196]o problems yourself"
  200. 20019 data"page"
  201. 20020 data"      1) [211]ee examples done"
  202. 20021 data"         [163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
  203. 20022 data"[201]f you want to see examples done,"
  204. 20023 data"[201] will show you how to do them,"
  205. 20024 data"explaining each step as [201] go."
  206. 20025 data"page"
  207. 20026 data"   2) [196]o problems with help"
  208. 20027 data"      [163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
  209. 20028 data"[212]o do problems with help, [201] will"
  210. 20029 data"give you a hint for each step,"
  211. 20030 data"and help you if you make mistakes."
  212. 20031 data"page"
  213. 20032 data"     3) [196]o problems yourself"
  214. 20033 data"        [163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
  215. 20034 data"[212]he third option is to work problems"
  216. 20035 data"on your own.  [198]or this option,"
  217. 20036 data"you may need pencil and paper."
  218. 20037 data"page"
  219. 20038 data"      [206]umber of [208]roblems"
  220. 20039 data"      [163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
  221. 20040 data"[204]ast, you decide how many problems"
  222. 20041 data"to do.  [201]f you let the computer do"
  223. 20042 data"the work, you may only have 5"
  224. 20043 data"problems; otherwise you may have"
  225. 20044 data"from 1 to 20 problems."
  226. 20045 data"page"
  227. 30000 rem **** see examples done ****
  228. 30010 cc$=chr$(159):cw$=chr$(5):cr$=chr$(co(int(rnd(1)*4)+1))
  229. 30020 forl=1to2:i(l)=int(rnd(1)*9)+1:nextl
  230. 30030 i(3)=i(1):ifi(1)>i(2)theni(3)=i(2)
  231. 30040 i(4)=i(2):ifi(1)>i(2)theni(4)=i(1)
  232. 30050 i(5)=int(rnd(1)*4)+1
  233. 30060 i3$=str$(i(3)):i4$=str$(i(4))
  234. 30070 printchr$(142):gosub32000
  235. 30080 gosub32000
  236. 30100 tx$="look at the fraction:":v=6:h=1:gosub3200
  237. 30150 forl=1to3:tx$=nu$(i(3),l):v=9+l:h=30:gosub3200:nextl
  238. 30170 tx$="[162][162][162][162][162]":v=14:h=29:gosub3200
  239. 30190 forl=1to3:tx$=nu$(i(4),l):v=15+l:h=30:gosub3200:nextl:delay=1:gosub2000
  240. 30200 rem ****test for 1 set is/are****
  241. 30210 t1$="are":t2$="shapes":ifi(3)=1thent1$="is":t2$="shape"
  242. 30230 t3$="are":t4$="parts":ifi(4)=1thent3$="is":t4$="part"
  243. 30300 vt=9:h=5:forj=1toi(4)
  244. 30310 v=vt:forl=1to2:tx$=sh$(i(5),l):v=v+1:gosub3200:nextl
  245. 30320 h=h+5:ifh=20thenvt=vt+3:h=5
  246. 30330 nextj
  247. 30400 vt=9:h=5:forj=1toi(3)
  248. 30410 v=vt:forl=1to2:tx$=cr$+sh$(i(5),l)+cw$:v=v+1:gosub3200:nextl
  249. 30420 h=h+5:ifh=20thenvt=vt+3:h=5
  250. 30430 nextj
  251. 30450 onopgoto30500,31000,31300
  252. 30500 tx$="there "+t3$+" "+i4$+" "+t4$+" in the whole.":v=22:h=1:gosub3200
  253. 30510 delay=2:gosub2000
  254. 30520 tx$="                                     ":v=22:h=1:gosub3200
  255. 30530 tx$="the fraction means"+i3$+" of the"+i4$+" "+t4$+".":v=22:h=1:gosub3200
  256. 30540 delay=2:gosub2000
  257. 30550 tx$="                                     ":v=22:h=1:gosub3200
  258. 30560 tx$="the denominator is"+i4$+".":v=22:h=1:gosub3200:delay=2:gosub2000
  259. 30570 tx$="denominator":v=20:h=26:gosub3200
  260. 30580 tx$="                                     ":v=22:h=1:gosub3200
  261. 30610 tx$="there "+t1$+i3$+" colored "+t2$+".":v=22:h=1:gosub3200
  262. 30620 delay=2:gosub2000
  263. 30630 tx$="                                     ":v=22:h=1:gosub3200
  264. 30640 tx$="the numerator is "+i3$+".":v=22:h=1:gosub3200
  265. 30650 tx$=cr$+"numerator"+cw$:v=8:h=27:gosub3200
  266. 30660 forl=1to3:tx$=cr$+nu$(i(3),l)+cw$:v=9+l:h=30:gosub3200:nextl
  267. 30700 return
  268. 31000 rem **** op 2 ****
  269. 31010 tx$="what is the denominator ?":v=22:h=1:gosub3200:delay=2:gosub2000
  270. 31030 gosub2100:tx$=a$:h=27:gosub3200:ifa=i(4)thengosub300:goto31100
  271. 31050 tx$="                                   ":v=22:h=0:gosub3200
  272. 31060 tx$="there "+t3$+" "+i4$+" "+t4$+" in the whole.":v=22:h=1:gosub3200
  273. 31070 delay=2:gosub2000
  274. 31080 tx$="denominator":v=20:h=26:gosub3200
  275. 31100 forv=22to24:tx$="                                   ":h=0:gosub3200:nextv
  276. 31110 tx$="what is the numerator ?":v=22:h=1:gosub3200
  277. 31120 gosub2100:tx$=a$:h=27:gosub3200:ifa=i(3)thengosub300:return
  278. 31150 tx$="                                   ":v=22:h=0:gosub3200
  279. 31160 goto30610
  280. 31190 return
  281. 31300 rem **** op 3 ****
  282. 31310 tx$="what is the denominator ?":v=22:h=1:gosub3200
  283. 31320 gosub2100:tx$=a$:a1=a:h=27:gosub3200
  284. 31330 tx$="what is the numerator ?":v=23:h=1:gosub3200
  285. 31340 gosub2100:tx$=a$:a2=a:h=27:gosub3200
  286. 31350 ifa1=i(4)anda2=i(3)thengosub300:return
  287. 31360 forl=1to3:tx$="                              ":v=20+l:h=1:gosub3200:nextl
  288. 31370 tx$="let me show you this one.":v=21:h=1:gosub3200:delay=2:gosub2000
  289. 31380 tx$="                                     ":gosub3200
  290. 31390 mi=mi+1:goto30500
  291. 32000 tx$=cc$+"[182][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][181]":v=8:h=2:gosub3200
  292. 32010 forl=1to10:tx$="[182]                [181]":v=v+1:gosub3200:nextl
  293. 32020 tx$="[182][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][181]"+cw$:v=v+1:gosub3200
  294. 33000 return
  295. 60000 :
  296. 60010 : rem input routine
  297. 60020 :
  298. 60030 l%=len(i$) : c%=0
  299. 60040 print i$; c1$; : poke 198,0
  300. 60050 :
  301. 60060 get g$
  302. 60070 if g$="" then c%=c%+1 : if c%>20 then print c1$; : c%=0 : goto 60060
  303. 60080 if g$="" then if c%>10 then print c2$; : goto 60060
  304. 60090 if g$="" then 60060
  305. 60100 :
  306. 60110 : rem return key
  307. 60120 :
  308. 60125 if g$<>chr$(13) then 60150
  309. 60130 if no%=1 then no%=0
  310. 60140 print " " : return
  311. 60150 :
  312. 60160 : rem del key
  313. 60170 :
  314. 60180 if g$<>chr$(20) then 60230
  315. 60190 if l%=0 then 60060
  316. 60200 print"[157]  [157][157]";c1$;
  317. 60210 l% = l%-1 : i$=left$(i$,l%)
  318. 60220 goto 60060
  319. 60230 :
  320. 60240 : rem add a key
  321. 60250 :
  322. 60260 if l%>=mx% then 60060
  323. 60262 if no%=0 then 60270
  324. 60263 if (g$<"0" or g$>"9") and g$<>"." and g$<>"-" then 60060
  325. 60264 goto 60290
  326. 60270 if (g$<" " or g$>"[218]") then 60060
  327. 60280 if (g$>"_" and g$<"[193]") then 60060
  328. 60290 i$=i$+g$ : l%=l%+1
  329. 60300 print g$; c1$; : c%=0
  330. 60310 goto 60060
  331. 60320 :
  332.