home *** CD-ROM | disk | FTP | other *** search
/ UpTime Volume 2 #8 / utv2n8s2.d64 / NU (.txt) < prev    next >
Commodore BASIC  |  2022-08-28  |  9KB  |  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