home *** CD-ROM | disk | FTP | other *** search
/ UpTime Volume 2 #8 / utv2n8s2.d64 / RE (.txt) < prev    next >
Commodore BASIC  |  2022-08-28  |  10KB  |  372 lines

  1. 1 rem **** reducing fractions 1/20/88
  2. 5 clr
  3. 10 poke53280,0:poke53281,0
  4. 15 a1=1
  5. 17 c1$="[164][157]" : c2$=" [157]" : c%=0 : i$="" : no% = 0
  6. 20 dims(9),s$(11),se$(11),nu$(10,3)
  7. 100 gosub4000:printchr$(14)
  8. 105 gosub10000
  9. 110 gosub3700
  10. 120 h=0:v=10:tx$="[196]o you need a lesson? "
  11. 130 gosub3200
  12. 140 lo=0:gosub2100:printa$
  13. 150 ifa$="y"ora$="[217]"thengosub20000:goto 160
  14. 151 if a$="n" or a$="[206]" then 160
  15. 152 goto 120
  16. 160 gosub5000
  17. 165 ru=1
  18. 170 gosub1000
  19. 172 print chr$  (14):gosub 3700:ifop<>3then191
  20. 174 gosub3700
  21. 176 gosub500
  22. 190 gosub 3700
  23. 191 h=0:v=10:tx$="[196]o you want to play again? "
  24. 200 gosub3200
  25. 210 lo=0:gosub2100:printa$
  26. 220 ifa$="y"ora$="[217]"then160
  27. 221 if a$="n" or a$="[206]" then 230
  28. 222 goto 191
  29. 230 clr:poke53269,0:load"menu",8
  30. 240 stop
  31. 300 rem **** rewards ****
  32. 310 rw=int(rnd(1)*6)+1:rw$=rw$(rw)
  33. 320 forl=1to4:v=24:gosub3900:delay=.3:gosub2000
  34. 330 tx$=chr$(co(l))+rw$+chr$(5):gosub3000:gosub3200:delay=.3:gosub2000:next l
  35. 340 return
  36. 500 v=10:h=0:tx$="[217]ou got"+str$(np-mi)+" right out of"+str$(np)+" problems"
  37. 501 print chr$(14)
  38. 510 gosub3200
  39. 540 v=12:tx$="for "+str$(int(((np-mi)/np)*100))+"%."
  40. 545 gosub3200
  41. 550 delay=7:gosub2000
  42. 560 return
  43. 1000 rem *** central routine ***
  44. 1005 hp=0:mi=0
  45. 1007 print"[147]"
  46. 1010 fori=1tonp
  47. 1030 gosub3600
  48. 1040 gosub30000
  49. 1066 v=24:tx$="   <return> to continue, <_> to exit[146]"
  50. 1067 gosub3000:gosub3200
  51. 1068 lo=0:gosub2100
  52. 1069 ifa$="_"then sa=i:i=np
  53. 1070 next i: if sa<>0 then np=sa
  54. 1080 return
  55. 2000 rem *** timer ***
  56. 2010 ti$="000000"
  57. 2015 geta$:ifa$<>""then2030
  58. 2020 ifti/60<delaythen2015
  59. 2030 return
  60. 2100 rem *** get character ***
  61. 2110 geta$:ifa$=""then2110
  62. 2120 a=val(a$):ifa<loora>hithen2110
  63. 2130 return
  64. 2499 rem **** remove leading spaces ****
  65. 2500 l=len(sp$):ifleft$(sp$,1)<>" "thengoto2520
  66. 2510 l=l-1:sp$=right$(sp$,l)
  67. 2520 return
  68. 3000 rem *** center text ***
  69. 3010 ln=len(tx$)
  70. 3020 h=(40-ln)/2
  71. 3030 return
  72. 3100 v=24:tx$="   <[210][197][212][213][210][206]> to continue[146]"
  73. 3110 gosub3000:gosub3200
  74. 3120 lo=0:gosub2100
  75. 3130 ifa$<>chr$(13) then 3100
  76. 3140 return
  77. 3200 rem *** hor/ver tab ***
  78. 3210 vt$="":forq=1tov
  79. 3220 :vt$=vt$+""
  80. 3230 nextq
  81. 3240 print"";vt$;
  82. 3250 printtab(h);tx$;
  83. 3260 return
  84. 3500 rem *** line across screen ***
  85. 3510 print"";
  86. 3520 forq=1to40
  87. 3530 :print"[192]";
  88. 3540 nextq
  89. 3575 print"";
  90. 3580 return
  91. 3600 rem *** print screen header ***
  92. 3610 print"[147]"
  93. 3630 tx$="vision software presents:"
  94. 3640 h=10
  95. 3650 v=1:gosub3200
  96. 3660 tx$=t$
  97. 3665 print"";
  98. 3670 h=10
  99. 3680 v=3:gosub3200
  100. 3685 print"";
  101. 3690 print:gosub3500:return
  102. 3700 rem *** print screen header ***
  103. 3710 print"[147]"
  104. 3740 h=10:tx$="[214][201][211][201][207][206][160][211][207][198][212][215][193][210][197] presents:"
  105. 3750 v=1:gosub3200
  106. 3760 tx$="[210]educing [198]ractions"
  107. 3765 print"";
  108. 3770 h=10
  109. 3780 v=3:gosub3200
  110. 3785 print"";
  111. 3790 print:gosub3500:return
  112. 3900 rem **** blank a line ****
  113. 3910 tx$="                                      ":h=0:gosub3200:return
  114. 4000 rem *** read data ***
  115. 4005 readt$
  116. 4010 fori=1to6
  117. 4020 :readrw$(i)
  118. 4030 nexti
  119. 4040 fori=1to3
  120. 4050 :readop$(i)
  121. 4060 nexti
  122. 4070 for i=1 to 4: read co(i):nexti
  123. 4080 fori=0to9:forl=1to3:readnu$(i,l):nextl:nexti
  124. 4090 forl=1to4:readsh$(l):nextl
  125. 4098 return
  126. 4100 rem *** program data ***
  127. 4110 data"reducing fractions"
  128. 4120 data"great!","fantastic!","super!"
  129. 4130 data"you're really going now!","yes!  yes!  yes!","that's great!"
  130. 4140 data"[211]ee examples done."
  131. 4150 data"[196]o problems with help."
  132. 4160 data"[196]o problems yourself."
  133. 4170 data 30,28,31,158
  134. 4200 data"[213][195][201]","[221] [221]","[202][195][203]"
  135. 4210 data" [174] "," [221] "," [177] "
  136. 4220 data"[213][195][201]","[213][195][203]","[173][195][189]"
  137. 4230 data"[213][195][201]"," [195][179]","[202][195][203]"
  138. 4240 data"[176] [176]","[173][195][179]","  [177]"
  139. 4250 data"[176][195][174]","[173][195][201]","[202][195][203]"
  140. 4260 data"[213][195][201]","[171][195][201]","[202][195][203]"
  141. 4270 data"[176][195][174]","  [221]","  [177]"
  142. 4280 data"[213][195][201]","[171][195][179]","[202][195][203]"
  143. 4290 data"[213][195][201]","[202][195][179]","[202][195][203]"
  144. 4300 data"[193]","[211]","[218]","[216]"
  145. 5000 rem *** setup for math ***
  146. 5001 ifru=1then5030
  147. 5005 tx$="                                    ":v=10:h=0:gosub3200
  148. 5010 ifru=1then5037
  149. 5015 tx$="                                    ":v=10:h=0:gosub3200
  150. 5020 h=0:v=7:tx$="[215]hat's your first name? ":gosub3200
  151. 5022 mx%=20:i$="":gosub60000:nf$=i$:ifnf$=""then5020
  152. 5025 h=0:v=9:tx$="[215]hat's your last name? ":gosub3200:i$="":gosub60000:nl$=i$
  153. 5030 v=12:h=0:tx$="[215]ould you like to:                     ":gosub3200
  154. 5040 h=7:v=14:fori=1to3
  155. 5050 :tx$=str$(i)+". "+op$(i):gosub3200
  156. 5080 v=v+1:nexti
  157. 5090 v=18:h=0:tx$="[217]our choice? (1-3) "
  158. 5100 gosub3200
  159. 5110 lo=1:hi=3:gosub2100:printa$
  160. 5120 op=a:hi=20
  161. 5130 ifop=1thenhi=5
  162. 5150 v=21:h=0:tx$="[200]ow many problems do you want"
  163. 5160 gosub3200
  164. 5170 v=22:tx$="to do? (1 -"+str$(hi)+")   [157][157]"
  165. 5180 gosub3200
  166. 5190 mx%=2:no%=1:i$="":gosub60000:np=val(i$)
  167. 5200 ifnp<loornp>hithen np=0 :goto5170
  168. 5390 return
  169. 10000 rem *** do spritey things ***
  170. 10001 for i=704 to 767
  171. 10002 readx:pokei,x
  172. 10003 next
  173. 10004 poke2040,11
  174. 10005 poke53269,peek(53269)or1
  175. 10006 poke53287,2:poke53277,255:poke53271,255
  176. 10007 poke53248,30:poke53249,58
  177. 10008 return
  178. 10009 data252,252,252,121,249,248,51,243,240
  179. 10010 data7,231,224,15,207,192,7,159,128
  180. 10011 data3,63,0,0,126,0,0,252,0
  181. 10012 data0,120,0,0,48,0,0,0,0
  182. 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
  183. 20000 rem *** info info info ***
  184. 20001 gosub3700:v=6
  185. 20002 readn
  186. 20003 fori=1ton
  187. 20004 :readtx$
  188. 20005 :iftx$="page"thengosub 3100:gosub 3700:v=6 :goto20009
  189. 20006 :h=2:ifmid$(tx$,10,1)="[163]"thenv=v+1:gosub3200:goto20008
  190. 20007 :v=v+2:gosub3200
  191. 20008 :delay=.5:gosub2000
  192. 20009 nexti:n=0:return
  193. 20011 data35
  194. 20012 data"[211]ee how fractions can be reduced"
  195. 20013 data"to the lowest terms with this"
  196. 20014 data"program."
  197. 20015 data"[212]here are three ways to use the"
  198. 20016 data"program:","    1) [211]ee examples done"
  199. 20017 data"    2) [196]o problems with help"
  200. 20018 data"    3) [196]o problems yourself"
  201. 20019 data"page"
  202. 20020 data"      1) [211]ee examples done"
  203. 20021 data"         [163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
  204. 20022 data"[201]f you want to see examples done,"
  205. 20023 data"[201] will show you how to do them,"
  206. 20024 data"explaining each step as [201] go."
  207. 20025 data"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 help you if you make mistakes."
  213. 20031 data"page"
  214. 20032 data"     3) [196]o problems yourself"
  215. 20033 data"        [163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
  216. 20034 data"[212]he third option is to work problems"
  217. 20035 data"on your own. "
  218. 20036 data""
  219. 20037 data"page"
  220. 20038 data"      [206]umber of [208]roblems"
  221. 20039 data"      [163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
  222. 20040 data"[204]ast, you decide how many problems"
  223. 20041 data"to do.  [201]f you let the computer do"
  224. 20042 data"the work, you may only have 5"
  225. 20043 data"problems; otherwise you may have"
  226. 20044 data"from 1 to 20 problems."
  227. 20045 data"page"
  228. 30000 rem **** op 1 ****
  229. 30010 cc$=chr$(159):cw$=chr$(5)
  230. 30020 forl=1to2:i(l)=int(rnd(1)*9)+1:nextl:i(3)=int(rnd(1)*3)+2
  231. 30030 ifi(2)<=i(1)thengoto30020
  232. 30031 forl=2toi(1):ifint(i(1)/l)<>i(1)/lthen30033
  233. 30032 ifint(i(2)/l)=i(2)/lthen30020
  234. 30033 nextl
  235. 30040 i(4)=i(1)*i(3):i(5)=i(2)*i(3):sh$=sh$(int(rnd(1)*4)+1)
  236. 30050 forl=1to2:cr$(l)=chr$(co(int(rnd(1)*4)+1)):nextl:ifcr$(1)=cr$(2)then30050
  237. 30060 i3$=str$(i(3)):i1$=str$(i(1)):i2$=str$(i(2))
  238. 30061 sp$=i3$:gosub2500:i3$=sp$:sp$=i1$:gosub2500:i1$=sp$
  239. 30062 sp$=i2$:gosub2500:i2$=sp$
  240. 30070 printchr$(142):gosub32000
  241. 30080 onopgoto30100,30500,30800
  242. 30100 vp=9:hp=30:ifi(4)<10thenhp=hp+2
  243. 30110 cl$=cr$(1):pn=i(4):gosub32100
  244. 30120 tx$="[162][162][162][162][162][162][162][162]":v=13:h=30:gosub3200
  245. 30130 vp=15:hp=30:ifi(5)<10thenhp=hp+2
  246. 30140 cl$=cr$(2):pn=i(5)