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

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