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

  1. 1 if ru<>1 then clr:rem mixed 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)
  6. 100 gosub 7000:printchr$(14)
  7. 105 gosub10000
  8. 110 gosub480
  9. 250 goto 2000
  10. 300 n=n+1:rem if z=5 then n=n+1
  11. 310 rw=int(rnd(0)*6)+1:for j=1 to 4:v=19:h=1:gosub 920
  12. 320 gosub 990:gosub 610:delay=.05:gosub 940:v=19:gosub 920
  13. 330 tx$=chr$(co(j))+rw$(rw)+chr$(5):gosub 990:gosub 610:delay=.2:gosub 940
  14. 340 nextj:return
  15. 400 rem *** get character ***
  16. 410 geta$:ifa$=""then410
  17. 411 return
  18. 420 gosub 400:a=val(a$):ifa<loora>hithen420
  19. 421 return
  20. 480 print"[147]"
  21. 481 h=10:tx$="[214][201][211][201][207][206][160][211][207][198][212][215][193][210][197] presents:":v=1:gosub 600
  22. 482 tx$="[195]onverting [205]ixed [206]umerals"
  23. 483 print"";:h=10:v=3:gosub 600
  24. 484 print"";:print:gosub 800:return
  25. 490 print chr$(142): rem *** print screen header ***
  26. 491 print"[147]"
  27. 492 tx$="vision software presents:":h=10:v=1:gosub 610:tx$=t$
  28. 493 print"";:h=10:v=3:gosub 610
  29. 494 print"";:print:gosub 800:return
  30. 500 rem **** remove leading spaces ****
  31. 510 l=len(sp$):ifleft$(sp$,1)<>" "thengoto530
  32. 520 l=l-1:sp$=right$(sp$,l)
  33. 530 return
  34. 600 rem *** hor/ver tab ***
  35. 610 vt$="":forq=1tov
  36. 620 :vt$=vt$+"":next q
  37. 630 print"";vt$;:printtab(h);tx$;:return
  38. 800 print"";:for q=1 to 40
  39. 810 :print"[192]";:next q
  40. 820 print"";:return
  41. 830 printchr$(31);:tx$="[182][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][181]":v=v2:gosub610:tx$="[182]               [181]"
  42. 840 fori=1to8:v=v2+i:gosub610:nexti:tx$="[182][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][181]":v=v+1
  43. 850 gosub610: print"";:print:return
  44. 870 tx$="[210][210][210][210][210][210]":gosub 610:return
  45. 900 v=24:tx$="   <return> to continue, <_> to exit[146]":gosub 990:gosub 610
  46. 901 lo=0:gosub400:if a$="_" then 4000
  47. 902 ifa$<>chr$(13) then 900
  48. 903 return
  49. 910 v=24:tx$="   <[210][197][212][213][210][206]> to continue, <_> to exit[146]":gosub 990:gosub 610
  50. 911 lo=0:gosub400:if a$="_" then 4000
  51. 912 ifa$<>chr$(13) then 910
  52. 913 return
  53. 920 h=0:tx$="                                        ":gosub 610:return
  54. 940 ti$="000000"
  55. 941 geta$:ifa$<>""then943
  56. 942 ifti/60<delaythen941
  57. 943 return
  58. 990 ln=len(tx$):h=(40-ln)/2:return
  59. 1000 denom=int(rnd(0)*8)+2:num=int(rnd(0)*72)+3:if nun<denom then 1000
  60. 1010 for j=2 to 9:if num/j<>int(num/j) then 1030
  61. 1020 if denom/j=int(denom/j) then 1000
  62. 1030 next j:whole=int(num/denom):if whole>9 then 1000
  63. 1040 n2=whole*denom:n1=num-n2:n2$=str$(n2)
  64. 1050 num$=right$(str$(num),2):denom$=right$(str$(denom),1):
  65. 1060 n1$=right$(str$(n1),1):whole$=right$(str$(whole),1)
  66. 1070 eq$=whole$+" x "+denom$+" + "+n1$+" = " +num$:return
  67. 1100 rem write numbers
  68. 1110 for j=1 to 3:v=v1+j:h=h1:tx$=nu$(iq,j):gosub 610:next j :return
  69. 2000 if ru=1 then 2035
  70. 2010 h=0:v=10:tx$="[196]o you need a lesson? ":gosub 600:lo=0:gosub 400
  71. 2020 ifa$="y"ora$="[217]"thenprinta$:  gosub20000:goto 2035
  72. 2021 if a$="n" or a$="[206]" thenprinta$:goto2030
  73. 2022 a$="":goto 2010
  74. 2030 tx$="                                    ":v=10:h=0:gosub600
  75. 2035 h=0:v=7:tx$="[215]hat's your first name? ":gosub610
  76. 2036 mx%=20:i$="":gosub60000:nf$=i$:if nf$="" then 2035
  77. 2040 h=0:v=9:tx$="[215]hat's your last name? ":gosub600
  78. 2042 mx%=20:i$="":gosub60000:nl$=i$
  79. 2045 v=11:h=0:tx$="[215]ould you like to:                     ":gosub600
  80. 2048 h=7:v=13:fori=1to3:tx$=str$(i)+". "+op$(i):gosub 610:v=v+1:next i
  81. 2050 lo=1:hi=3:tx$="[217]our choice: (1-3) ":h=0:v=v+1:gosub 610:gosub 420:printa$
  82. 2060 op=a:hi=20:if op=1then hi=5
  83. 2065 v=19:h=0:tx$="[200]ow many problems do you want":gosub 610
  84. 2070 v=20:tx$="to do? (1 -"+str$(hi)+")   [157][157]" :gosub 610
  85. 2072 mx%=2:no%=1:i$="":gosub60000:np=val(i$)
  86. 2075 ifnp<loornp>hithen np=0 :goto2065
  87. 2110 fork=1tonp
  88. 2120 gosub 1000:gosub 490:tx$="change this mixed numeral:":v=6:h=2:gosub 610
  89. 2125 v2=8:h=0:gosub 830
  90. 2128 v1=10:h1=3 :iq=whole:gosub 1110
  91. 2130 v1=8:h1=9:iq=n1:gosub 1110:v1=13:h1=9:v=12:h=8:gosub870:iq=denom:gosub1110
  92. 2140 on op gosub 2200,2300,2400
  93. 2150 gosub 900:nextk:goto 4000
  94. 2200 rem op 1
  95. 2210 tx$="the denominator stays the same.":v=19:h=1:gosub 610:iq=denom:v=12
  96. 2220 h=27:gosub 870:v1=13: h1=29:gosub 1110:delay=3:gosub940:v=19:h=0:gosub920
  97. 2225 n3$="numbers":if whole=1 then n3$="number"
  98. 2230 tx$="multiply the whole "+n3$+" by "+denom$+".":v=19:h=0:gosub610
  99. 2240 tx$=whole$+" x "+denom$:v=21:h=0:gosub610:delay=1
  100. 2250 gosub 940:v=19:gosub 920
  101. 2260 h=0:gosub610:tx$="now add the numerator: ":h=0:v=19:gosub610
  102. 2270 tx$=eq$:h=0:v=21:gosub 610:h1=27:for i=1to2:if num<=9 then h1=29
  103. 2280 iq=val(mid$(num$,i,1)):v1=8:gosub 1110:h1=h1+3:nexti:return
  104. 2300 rem op 2
  105. 2310 tx$="the denominator stays the same.":v=19:h=1:gosub 610:iq=denom:v=12
  106. 2320 h=27:gosub 870:v1=13: h1=29:gosub 1110:delay=3:gosub940:v=19:h=0:gosub920
  107. 2325 n3$="numbers":if whole=1 then n3$="number"
  108. 2330 tx$="multiply the whole "+n3$+" by "+denom$+".":v=19:h=0:gosub610
  109. 2340 tx$=whole$+" x "+denom$+" = ? ":v=21:h=0:gosub610
  110. 2342 mx%=20:no%=1:i$="":gosub60000:an=val(i$)
  111. 2350 if an=n2 thenv=19:h=0:gosub920:gosub 300:v=19:h=0:gosub920:goto2360
  112. 2355 v=21:gosub920:tx$=wh$+" x "+de$+" = "+n2$:v=21:gosub610:de=1:gosub940
  113. 2360 h=0:gosub610:v=19:gosub920:tx$="now add the numerator: ":h=0:v=19:gosub610
  114. 2365 v=21:h=0:gosub920:tx$=whole$+" x "+denom$+" + "+n1$+" ? ":gosub610
  115. 2366 mx%=20:no%=1:i$="":gosub60000:n4$=i$
  116. 2370 tx$=eq$:h=0:v=21:gosub 610:h1=27:for i=1to2:if num<=9 then h1=29
  117. 2380 iq=val(mid$(num$,i,1)):v1=8:gosub 1110:h1=h1+3:nexti
  118. 2385 o=val(n4$):ifo=numthenv=19:gosub920:gosub300
  119. 2390 return
  120. 2400 rem op 3
  121. 2410 tx$="the denominator stays the same.":v=19:h=1:gosub 610:iq=denom:v=12
  122. 2420 h=27:gosub 870:v1=13: h1=29:gosub 1110:delay=3:gosub940:v=19:h=0:gosub920
  123. 2430 tx$="the new numerator is: ? ":v=21:h=0:gosub610
  124. 2432 mx%=20:no%=1:i$="":gosub60000:an=val(i$)
  125. 2435 g=g+1:if an=num then 2450
  126. 2440 rv=1:v=19:gosub 920:tx$="let me show you this one."
  127. 2441 v=21:h=0:gosub 610:de=.7:gosub 940:v=19:gosub 920:v=21:gosub 920:gosub2225
  128. 2442 rv=0:goto 2495
  129. 2450 ifan=numthenv=19:gosub920:gosub300
  130. 2460 h1=27:for i=1to2:if num<=9 then h1=29
  131. 2470 iq=val(mid$(num$,i,1)):v1=8:gosub 1110:h1=h1+3:nexti
  132. 2495 return
  133. 4000 print chr$(14):gosub 480:if op<>3 then 4100
  134. 4005 v=10:h=0:tx$="[217]ou got"+str$(n)+" right out of"+str$(g)+" problems"
  135. 4010 gosub 610:v=12:tx$="for "+str$(int((n/g)*100))+"%."
  136. 4020 gosub610:delay=3:gosub 940
  137. 4100 h=0:v=15:tx$="[196]o you want to play again? " :gosub 610
  138. 4120 lo=0:gosub400 :printa$:if a$="y" or a$="[217]" then clr:ru=1 :goto 1
  139. 4130 if a$="n" or a$="[206]" then 4150
  140. 4140 goto 4120
  141. 4150 clr:poke53269,0:load"menu",8
  142. 4200 stop
  143. 5390 return
  144. 7000 rem *** read data ***
  145. 7010 readt$:for i=1 to 6:read rw$(i):next i
  146. 7020 fori=1to3:read op$(i):next i:for i=1 to 4:read co(i):next i
  147. 7030 fori=0to9:forj=1to3:readnu$(i,j):nextj:nexti
  148. 7040 return
  149. 8000 rem *** program data ***
  150. 8010 data"converting mixed numerals"
  151. 8020 data"great!","fantastic!","super!"
  152. 8030 data"you're really going now!","yes!  yes!  yes!","that's great!"
  153. 8040 data"[211]ee examples done."
  154. 8050 data"[196]o problems with help."
  155. 8060 data"[196]o problems yourself."
  156. 8070 data 30,28,31,158
  157. 8075 data"[213][195][201]"
  158. 8076 data"[221] [221]"
  159. 8077 data"[202][195][203]"
  160. 8080 data" [174] "," [221] "," [177][160]"
  161. 8090 data"[213][195][201]","[213][195][203]","[173][195][189]"
  162. 8100 data"[213][195][201]"," [195][179]","[202][195][203]"
  163. 8110 data"[221] [221]","[173][195][179]"
  164. 8115 data"  [177]"
  165. 8120 data"[176][195][174]","[173][195][201]","[202][195][203]"
  166. 8130 data"[213][195][201]","[171][195][201]","[202][195][203]"
  167. 8140 data"[176][195][174]","  [221]"
  168. 8145 data"  [177]"
  169. 8150 data"[213][195][201]","[171][195][179]","[202][195][203]"
  170. 8160 data"[213][195][201]","[202][195][179]","[202][195][203]"
  171. 10000 rem *** do spritey things ***
  172. 10001 for i=704 to 767
  173. 10002 readx:pokei,x
  174. 10003 next
  175. 10004 poke2040,11
  176. 10005 poke53269,peek(53269)or1
  177. 10006 poke53287,2:poke53277,255:poke53271,255
  178. 10007 poke53248,30:poke53249,58
  179. 10008 return
  180. 10009 data252,252,252,121,249,248,51,243,240
  181. 10010 data7,231,224,15,207,192,7,159,128
  182. 10011 data3,63,0,0,126,0,0,252,0
  183. 10012 data0,120,0,0,48,0,0,0,0
  184. 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
  185. 20000 rem *** info info info ***
  186. 20001 gosub480:v=6:readn:for i=1 to n:read tx$
  187. 20002 :iftx$="page"thengosub 910 :gosub 480:v=6 :goto20009
  188. 20003 h=2:ifmid$(tx$,10,1)="[163]"thenv=v+1:gosub610:goto20008
  189. 20007 :v=v+2:gosub610
  190. 20008 :delay=.5:gosub940
  191. 20009 nexti:n=0:return
  192. 20011 data35
  193. 20012 data"[212]his program can help you change"
  194. 20013 data"mixed numbers to fractions so that"
  195. 20014 data"you can work with fractions easily."
  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","page"
  200. 20020 data"      1) [211]ee examples done"
  201. 20021 data"         [163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
  202. 20022 data"[201]f you want to see examples done,"
  203. 20023 data"[201] will show you how to do them,"
  204. 20024 data"explaining each step as [201] go.","page"
  205. 20026 data"   2) [196]o problems with help"
  206. 20027 data"      [163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
  207. 20028 data"[212]o do problems with help, [201] will"
  208. 20029 data"give you a hint for each step,"
  209. 20030 data"and correct any mistakes you make.","page"
  210. 20032 data"     3) [196]o problems yourself"
  211. 20033 data"        [163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
  212. 20034 data"[212]he third option is to work problems"
  213. 20035 data"on your own.  [217]ou should be able"
  214. 20036 data"to do these problems in your head.","page"
  215. 20038 data"      [206]umber of [208]roblems"
  216. 20039 data"      [163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
  217. 20040 data"[204]ast, you decide how many problems"
  218. 20041 data"to do.  [201]f you let the computer do"
  219. 20042 data"the work, you may only have 5"
  220. 20043 data"problems; otherwise you may have"
  221. 20044 data"from 1 to 20 problems.","page"
  222. 60000 :
  223. 60010 : rem input routine
  224. 60020 :
  225. 60030 l%=len(i$) : c%=0
  226. 60040 print i$; c1$; : poke 198,0
  227. 60050 :
  228. 60060 get g$
  229. 60070 if g$="" then c%=c%+1 : if c%>20 then print c1$; : c%=0 : goto 60060
  230. 60080 if g$="" then if c%>10 then print c2$; : goto 60060
  231. 60090 if g$="" then 60060
  232. 60100 :
  233. 60110 : rem return key
  234. 60120 :
  235. 60125 if g$<>chr$(13) then 60150
  236. 60130 if no%=1 then no%=0
  237. 60140 print " " : return
  238. 60150 :
  239. 60160 : rem del key
  240. 60170 :
  241. 60180 if g$<>chr$(20) then 60230
  242. 60190 if l%=0 then 60060
  243. 60200 print"[157]  [157][157]";c1$;
  244. 60210 l% = l%-1 : i$=left$(i$,l%)
  245. 60220 goto 60060
  246. 60230 :
  247. 60240 : rem add a key
  248. 60250 :
  249. 60260 if l%>=mx% then 60060
  250. 60262 if no%=0 then 60270
  251. 60263 if (g$<"0" or g$>"9") and g$<>"." and g$<>"-" then 60060
  252. 60264 goto 60290
  253. 60270 if (g$<" " or g$>"[218]") then 60060
  254. 60280 if (g$>"_" and g$<"[193]") then 60060
  255. 60290 i$=i$+g$ : l%=l%+1
  256. 60300 print g$; c1$; : c%=0
  257. 60310 goto 60060
  258. 60320 :
  259.