home *** CD-ROM | disk | FTP | other *** search
/ UpTime Volume 2 #5 / utv2n5s2.d64 / vision.exe (.txt) < prev    next >
Encoding:
Commodore BASIC  |  1988-01-01  |  10.4 KB  |  315 lines

  1. 5 rem  **** fractions to decimals ****
  2. 10 poke 53280,0:poke 53281,0:print"[147]";
  3. 12 poke 45,peek(174):poke 46,peek(175):clr
  4. 15 gn$="[198]ractions to [196]ecimals"
  5. 17 gosub 5000
  6. 20 for z=54272 to 54296:poke z,.:next:ford=1to6:readre$(d):next
  7. 25 data "[199]reat!","[198]antastic!","[211]uper!","[217]ou've got it!"
  8. 26 data "[217]es! [217]es! [217]es!","[212]hat's [199]reat!"
  9. 28 forx=0to7:reada:poke30936+x,a:poke31056+x,peek(29320+x):next
  10. 30 data 0,128,192,224,240,224,192,128
  11. 40 get a$:ifa$<>" " then 40
  12. 95 goto 2000
  13. 100 rem *** zippy titles ***
  14. 105 rem ln=line# to place text
  15. 110 poke646,11:lc=(23-ln)/3
  16. 115 tb=(40-len(tx$))/2
  17. 120 ford=23tolnstep-1:print"";
  18. 125 ford1=1tod:print"";:next
  19. 130 ifd/6=int(d/6)then gosub165
  20. 135 printtab(tb)tx$
  21. 140 next
  22. 145 ford=23toln+1step-1:print"";
  23. 150 ford1=1tod:print"";:next
  24. 155 printtab(11)"                          "
  25. 160 next:return
  26. 165 ifpeek(646)=15thenpoke646,1
  27. 170 ifpeek(646)=12thenpoke646,15
  28. 175 ifpeek(646)=11thenpoke646,12
  29. 180 return
  30. 200 rem ***        clear          ***
  31. 210 for er=lnto23:poke 781,er:sys 59903:next:return
  32. 300 rem
  33. 305 rem ***     reward sound      ***
  34. 310 rem
  35. 320 poke 53280,2:poke 53281,2
  36. 325 s=54272:pokes+24,7:pokes+1,110:pokes+5,9:pokes+6,10:pokes+4,17:pokes+4,16
  37. 330 for d=1 to 25:next
  38. 332 poke 53280,5:poke 53281,5
  39. 335 s=54279:pokes+24,7:pokes+1,110:pokes+5,9:pokes+6,10:pokes+4,17:pokes+4,16
  40. 340 for d=1 to 25:next
  41. 342 poke 53280,6:poke 53281,6
  42. 345 s=54286:pokes+24,7:pokes+1,110:pokes+5,9:pokes+6,10:pokes+4,17:pokes+4,16
  43. 350 for d=1 to 25:next
  44. 352 poke 53280,0:poke 53281,0
  45. 355 sc=sc+1
  46. 365 return
  47. 400 rem
  48. 405 rem *** get numeric input ***
  49. 410 j$="":print"[164]";
  50. 415 get a$:if a$="" then 415
  51. 420 if a$=chr$(13) then print"[157] ":j=val(j$):mx=0:return
  52. 425 if a$=chr$(20) and j$="" then 415
  53. 430 if a$=chr$(20) then j$=left$(j$,len(j$)-1):print"[157][157]  [157][157][164]";:goto 415
  54. 433 if a$="[140]" then 470
  55. 435 if a$<" " or a$>"[218]" then 415
  56. 440 if a$>"z" and a$<"[193]" then 415
  57. 445 if a$=chr$(34) then 415
  58. 450 if len(j$)=mx then 415
  59. 455 print"[157] [157]"a$"[164]";
  60. 460 j$=j$+a$:goto 415
  61. 470 gosub 480:ln=1:tx$="[197]xit to [213]p[212]ime"
  62. 475 gosub 100:gosub 800:goto 4062
  63. 480 rem *** print screen header ***
  64. 481 print"[147]":poke53287,2:poke53288,12:poke53248,38:poke53249,56:poke 53250,38
  65. 482 poke 53251,56
  66. 485 forx=0to1:poke53277,peek(53277)or(2^x):poke 53271,peek(53271)or(2^x)
  67. 490 poke 53269,peek(53269)or(2^x):next
  68. 495 print"":return
  69. 499 forx=0to2:poke53269,peek(53269)and(255-2^x):next:return
  70. 500 rem ** short wrong sound **
  71. 505 wn$="028":s=54272:pokes+6,96:pokes+24,15
  72. 510 forq=1to6 step3
  73. 515 pokes+1,val(mid$(wn$,q,2)):pokes+4,33
  74. 520 forjw=1tot*val(mid$(wn$,q+2,1)):next:forr=1to100:next
  75. 525 pokes+4,0:next:return
  76. 600 rem
  77. 605 rem *** general purpose delay ***
  78. 610 rem
  79. 615 for qd=1 to 600:next
  80. 620 return
  81. 800 rem *** title bars ***
  82. 805 print"";:
  83. 810 print"[159][192][157][157][156][183][183][145][145]";
  84. 815 forx=1to23:print"[154][175][157][159][192][157][156][183][145][145]";:next
  85. 820 print"[154][175][175][157][157][159][192]":return
  86. 850 print"[154]";:goto 855
  87. 855 print"";
  88. 860 print"[172][192][192][192][192][192][187]"
  89. 865 forjw=1to3:print"[221][221]":next
  90. 870 print"[173][192][192][192][192][192][189]"
  91. 871 ifsf=1andop=4thensf=0:goto874
  92. 872 ifop=4thenreturn
  93. 874 print"[156][172][192][192][192][192][192][192][192][192][192][192][187]"
  94. 876 forjw=1to3:print"[221][221]":next
  95. 878 print"[173][192][192][192][192][192][192][192][192][192][192][189]"
  96. 880 return
  97. 900 rem *** continue or exit ***
  98. 902 print"";:ford=1to24:print"";:next
  99. 905 print"[154][169][208]ress [210][197][212][213][210][206] to [195]ontinue or _ to [197]xit[146][169][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][145][145][145]"
  100. 925 s=54272:pokes+24,7:pokes+1,110:pokes+5,9:pokes+6,10:pokes+4,17:pokes+4,16
  101. 930 getrc$:ifrc$=""then930
  102. 940 ifrc$="_"thencp=cp+1:goto 4000
  103. 950 ifrc$<>chr$(13)then930
  104. 960 return
  105. 980 print"";:forjg=1toy:print"";:nextjg:printtab(x);tx$;:return
  106. 990 x=(40-len(tx$))/2:goto980
  107. 1000 rem *** option 2 input ***
  108. 1005 nu$=str$(nu)
  109. 1010 j$="":ifop=3thenj$="."
  110. 1011 fordd=2tolen(nu$):mu=0
  111. 1014 tx$="":gosub980
  112. 1016 geta$:print"*[157] [157][159]*[157] [157][156]*[157] [157]*[157] [157]*[157] [157][158]*[157] [157][150]*[157] [157][153]*[157] [157][154]*[157] [157]";:ifa$=""then1016
  113. 1017 print"[146]"
  114. 1018 ifop>2thenj$=j$+a$:goto1050
  115. 1020 ifa$=mid$(nu$,dd,1)then1045
  116. 1035 gosub500:mu=mu+1:ifmu<>3then1014
  117. 1045 tx$=mid$(nu$,dd,1):gosub980:x=x+1:next:return
  118. 1050 ifop>2anda$=chr$(20)thenx=x-1:tx$=" ":gosub980:dd=dd-2
  119. 1051 ifop>2anda$=chr$(20)thenj$=left$(j$,len(j$)-2):next:return
  120. 1055 ifop>2thentx$=a$:gosub980:x=x+1:next:return
  121. 1100 rem *** wrong sound ***
  122. 1105 wn$="042034":s=54272:pokes+6,96:pokes+24,15
  123. 1110 forq=1to6 step3
  124. 1115 pokes+1,val(mid$(wn$,q,2)):pokes+4,33
  125. 1120 forjw=1tot*val(mid$(wn$,q+2,1)):next:forr=1to300:next
  126. 1125 pokes+4,0:next:return
  127. 2000 rem
  128. 2005 rem ***   main program   ***
  129. 2010 rem
  130. 2015 gosub480:ln=1:tx$="[198]ractions to [196]ecimals"
  131. 2016 print"";:gosub 100:gosub800
  132. 2017 tx$="[151] [208]ublished by [211]oftdisk [208]ublishing, [201]nc.":x=0:y=24:gosub 980
  133. 2020 x=0:y=10
  134. 2025 tx$="[196]o you want instructions? [145][164][164][164][164][164][157][157][157][157][157][165][217]/[206][167][157][157][157][157][157][163][163][163][163][163][145] "
  135. 2027 tx$=tx$+"       [157][157][157][157][157][157][157]":gosub 980
  136. 2030 mx=1:gosub400:i$=j$:ifi$="y"thengosub30000
  137. 2035 ifi$<>"n"andi$<>"y"thenprint"[145]";:goto2025
  138. 2038 ln=5:gosub200
  139. 2040 y=10:x=0:tx$="[215]hat is your name? "
  140. 2045 gosub 980:mx=20:gosub 400:nn$=j$:gosub200
  141. 2050 x=0:y=10:tx$="[215]hich option do you want:"
  142. 2053 gosub 980
  143. 2055 tx$="   1.  [196]emonstration.":y=12:gosub980
  144. 2060 tx$="   2.  [215]ork examples with help.":y=13:gosub980
  145. 2065 tx$="   3.  [211]tep-by-step problems.":y=14:gosub980
  146. 2068 tx$="   4.  [193]nswers only.":y=15:gosub980
  147. 2070 tx$="[217]our choice? [145][164][164][164][164][164][157][157][157][157][157][165]1-4[167][157][157][157][157][157][163][163][163][163][163][145] ":y=17:gosub980:mx=1:gosub400
  148. 2071 op=j:ifop>1thennp$="[145][164][164][164][164][164][164][157][157][157][157][157][157][165]5-20[167][157][157][157][157][157][157][163][163][163][163][163][163][145] "
  149. 2072 ifop=1thennp$="[145][164][164][164][164][164][157][157][157][157][157][165]1-5[167][157][157][157][157][157][163][163][163][163][163][145] "
  150. 2073 ifop<>1andop<>2andop<>3andop<>4then2070
  151. 2074 tx$="[200]ow many problems? "+np$:y=19:gosub980:mx=2:gosub400:np=j
  152. 2075 ifop=1then2078
  153. 2076 ifnp<5ornp>20then2074
  154. 2077 goto 2079
  155. 2078 ifnp<1ornp>5then2074:gosub900
  156. 2079 forcp=1tonp:ln=5:gosub200:gosub850
  157. 2082 n=int(rnd(1)*8)+1:d=int(rnd(1)*8)+2:an=n/d:ifan>=1then2082
  158. 2084 an$=str$(an):iflen(an$)>5andint(rnd(1)*2)+1=1then2082
  159. 2086 iflen(an$)>5thenan=val(left$(an$,5))
  160. 2088 tx$="[195]hange this fraction":x=0:y=8:gosub980:tx$="to a decimal.":y=9
  161. 2090 gosub980:tx$=str$(n):x=30:y=7:gosub980:tx$="[192][192][192]":y=8:x=30:gosub980
  162. 2092 tx$=str$(d):y=9:x=30:gosub980
  163. 2094 an$=str$(an):d$=str$(d):n$=str$(n)
  164. 2096 iflen(an$)=5then2098
  165. 2097 fordd=1to(5-len(an$)):an$=an$+"0":next
  166. 2098 onopgosub2100,2200,2200,2400:gosub900:nextcp:goto4000
  167. 2100 rem *** demonstration ***
  168. 2104 gosub 600:gosub600
  169. 2105 tx$="[196]ivide the numerator":x=0:y=12:gosub980:gosub600
  170. 2110 tx$=n$+"[157][157][221].":y=14:x=26:gosub980:tx$="[176][192][192][192][192][192][192]":y=13:gosub980:gosub600
  171. 2120 tx$="by the denominator.":x=0:y=13:gosub980:gosub600
  172. 2125 tx$=d$:y=14:x=24:gosub980:gosub600
  173. 2130 tx$="[193]dd three zeros after":x=0:y=15:gosub980
  174. 2135 tx$="the decimal point.":y=16:gosub980:gosub600
  175. 2140 forx=29to31:y=14:tx$="0":fordd=1to200:next:gosub980:next
  176. 2145 tx$="[208]lace the decimal point for the answer.":x=0:y=18:gosub980:gosub600
  177. 2150 tx$=".":y=12:x=28:gosub980:gosub600
  178. 2155 tx$="[206]ow divide.":x=0:y=20:gosub980:gosub600
  179. 2160 fordd=3tolen(an$):tx$=mid$(an$,dd,1):x=26+dd:y=12:gosub980
  180. 2165 forbb=1to200:next:next
  181. 2167 ifsy=1thensy=0:op=1
  182. 2170 return
  183. 2200 rem *** with help ***
  184. 2205 tx$="[196]ivide the numerator":x=0:y=12:gosub980
  185. 2210 tx$="by the denominator.":x=0:y=13:gosub980
  186. 2215 tx$="[221]":y=14:x=26:gosub980:tx$="[176][192][192][192][192][192][192]":y=13:gosub980
  187. 2220 tx$="[197]nter the numerator.":x=0:y=15:gosub980:nu=n:y=14:x=27:gosub1000
  188. 2222 tx$=".":x=28:y=14:gosub980
  189. 2225 tx$="[197]nter the denominator.":x=0:y=15:gosub980:nu=d:y=14:x=25:gosub1000
  190. 2230 tx$="[193]dd three zeros after  ":x=0:y=15:gosub980
  191. 2235 tx$="the decimal point.":y=16:gosub980:gosub600
  192. 2240 forx=29to31:y=14:tx$="0":fordd=1to200:next:gosub980:next
  193. 2245 tx$="[208]lace the decimal point for the answer.":x=0:y=18:gosub980:gosub600
  194. 2250 tx$=".":y=12:x=28:gosub980:gosub600
  195. 2255 tx$="[206]ow divide.":x=0:y=20:gosub980
  196. 2260 nu$=right$(an$,4):x=29:y=12:gosub1010:ifop=3then2300
  197. 2270 return
  198. 2300 rem *** step by step ***
  199. 2305 ifval(j$)=val(an$)then2340
  200. 2310 gosub 1100:tx$="[212]he correct answer is"+an$+".":y=20:x=0:gosub980
  201. 2315 tx$="[211]hall [201] show you this one? [145][164][164][164][164][164][157][157][157][157][157][165][217]/[206][167][157][157][157][157][157][163][163][163][163][163][145] "
  202. 2320 x=0:y=22:gosub980:mx=1:gosub400:ifj$="n"thenreturn
  203. 2325 ifop=4thensf=1
  204. 2326 ln=5:gosub200:gosub850
  205. 2328 tx$="[195]hange this fraction":x=0:y=8:gosub980:tx$="to a decimal.":y=9
  206. 2330 gosub980:tx$=str$(n):x=30:y=7:gosub980:tx$="[192][192][192]":y=8:x=30:gosub980
  207. 2331 tx$=str$(d):y=9:x=30:gosub980
  208. 2332 gosub600:goto 2105
  209. 2340 tx$=re$(int(rnd(1)*6)+1):gosub300:y=22:ifop=4theny=16
  210. 2345 gosub990:gosub600:return
  211. 2400 rem *** answers only ***
  212. 2410 tx$="[197]nter the decimal:":x=0:y=12:gosub980:nu$=right$(an$,5)
  213. 2415 x=19:y=12:gosub1010:goto 2300
  214. 4000 rem
  215. 4005 rem *** print score and give ***
  216. 4010 rem ***  option of playing   ***
  217. 4015 rem ***        again         ***
  218. 4020 rem
  219. 4025 cp=cp-1:ln=5:gosub200
  220. 4030 ifop<3then4062
  221. 4035 tx$="[217]ou got"+str$(sc)+" right out of"+str$(cp)+" problems."
  222. 4037 y=10:x=0:gosub980
  223. 4038 sc=int((sc/cp)*100):ifsc>100thensc=100
  224. 4040 tx$="[212]hat makes"+str$(sc)+" percent.":y=12:x=0:gosub980
  225. 4062 tx$="[196]o you want to play again? [165][217]/[206][167][145][157][157][157][157][157][164][164][164][164][164][157][157][157][157][157][163][163][163][163][163][145]":sc=0
  226. 4065 x=0:y=15:gosub980:mx=1:gosub400
  227. 4067 ifj$="y"then 4100
  228. 4070 sc=0:tx$="[196]oes anyone else want to play? [165][217]/[206][167][145][157][157][157][157][157][164][164][164][164][164][157][157][157][157][157][163][163][163][163][163][145]"
  229. 4075 x=0:y=17:gosub980:mx=1:gosub400:ifj$="y"then 2000
  230. 4080 sys 8*4096+4
  231. 4100 gosub480:ln=1:tx$="[198]raction to [196]ecimals"
  232. 4110 gosub100:gosub800:tx$="[151] [208]ublished by [214]iking [212]echnologies, [201]nc."
  233. 4120 x=0:y=24:gosub 980:goto 2050
  234. 5000 print"[142]";:gosub 480:ln=1:tx$="vision software":gosub 100
  235. 5010 ln=2:tx$="and uptime presents":gosub 100
  236. 5020 gosub 5200
  237. 5030 print"[158]  [161][172][162][146][190][161][172][187][146][187] [190][188][146] [172][172][187][146][187][188][187][172][146][190][188] [146][190][172][172][187][146][187][161][188][161][146][161][172][172][187][146][187]"
  238. 5040 print"  [161][188][146][187] [161][188][190][146][190][161][188][190][146][161][161][146][161]   [161][146][161]   [146] [161][146][161][161][146][161][161]  [146][161][188][188][146][162]"
  239. 5050 print"  [161][146][161]  [161][172][188][146] [161][146][161][161][146][161][161][146][161][172][187] [161][146][161]   [146] [161][146][161][161][146][161][161][146][161][187][146][161][172][187][161][146][161]"
  240. 5060 print"  [188][190]  [188][190][188][190][188][190][188][190] [162][162][146]  [188][190] [188][162][146][190] [162][162][146] [188][190][188][190] [162][162]"
  241. 5070 printtab(17)"[187][146][190] [191][146][191]"
  242. 5080 printtab(17)"[161][146]  [191][191]"
  243. 5100 print"    [161][172][188][146] [161][172][162][146][190][172][172][187][146][187][188] [146][190][161][188][146][172] [146] [190][188][146] [161][146][161]  [172][172][187][146][187]"
  244. 5110 print"    [161][146][161][161][146][161][161][188][146][187][146] [161][146][161]    [146] [161][172][172] [161][188][190][146][161][161][146][161]  [188][188][146][162]"
  245. 5120 print"    [161][146][161][190][146][190][161][146][161]  [161][146][161][172][187]  [146] [161][146][161]  [161][146][161][161][146][161][161][146][161]  [172][187][161][146][161]"
  246. 5130 print"    [188][162][146][190] [188][162][162][146][190] [162][162][146] [188][162][146][190][188][190] [162][146][188][190][188][190][188][162][162][146][190] [162][162]"
  247. 5140 poke 198,0
  248. 5150 printtab(7)"[159]press spacebar to continue"
  249. 5160 print"[151] published by softdisk publishing, inc."
  250. 5170 return
  251. 5200 print"";
  252. 5210 print"[159][192][157][157][156][183][183][145][145]";
  253. 5220 forx=1to23:print"[154][175][157][159][192][157][156][183][145][145]";:next
  254. 5230 print"[154][175][175][157][157][159][192]":return
  255. 5999 end
  256. 30000 rem
  257. 30005 rem *** instructions ***
  258. 30010 rem
  259. 30015 gosub480:ln=1:tx$="[201] n s t r u c t i o n s":gosub 100:gosub800
  260. 30020 print"    [204]earn to convert fractions to"
  261. 30025 print"decimal numbers with ease!  [212]here"
  262. 30030 print"are four ways to use this program:"
  263. 30038 print"                [207]ptions[157][157][157][157][157][157][157][163][163][163][163][163][163][163]"
  264. 30040 print"          1.  [196]emonstration."
  265. 30042 print"          2.  [215]ork examples with help."
  266. 30043 print"          3.  [211]tep-by-step problems."
  267. 30044 print"          4.  [193]nswers only."
  268. 30045 gosub 33000
  269. 30055 print"      [207]ption 1:  [196]emonstration."
  270. 30056 print"      [163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
  271. 30060 print"    [201] will show you, step by step,"
  272. 30062 print"how to convert a fraction into a"
  273. 30065 print"decimal number.  [201] will explain each"
  274. 30070 print"step as [201] go."
  275. 30080 gosub 33000
  276. 30090 print"  [207]ption 2: [215]ork examples with help."
  277. 30091 print"  [163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
  278. 30095 print"    [201] will give you a fraction, and"
  279. 30100 print"you must convert it into a decimal"
  280. 30105 print"number.  [215]e will work the problems"
  281. 30110 print"together, and [201] will guide you":print"through each step."
  282. 30111 print"   [201]f you enter a wrong answer, [201]"
  283. 30112 print"will correct you."
  284. 30115 gosub 33000
  285. 30125 print"       [207]ption 3: [211]tep-by-step."
  286. 30126 print"       [163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
  287. 30130 print"    [207]n option 3, [201] will allow you "
  288. 30135 print"to work the whole problem by yourself"
  289. 30140 print"for practice.  [201]f your final answer"
  290. 30142 print"is wrong, [201] will work the problem with"
  291. 30145 print"you.  [201] will keep your score on this"
  292. 30150 print"option.":gosub33000
  293. 30151 print"      [207]ption 4: [193]nswers only."
  294. 30152 print"      [163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
  295. 30153 print"   [215]ith answers only, you must find"
  296. 30154 print"the answer all by yourself, without"
  297. 30155 print"my help.  [217]ou may need paper and"
  298. 30156 print"and a pencil on this option."
  299. 30157 print"   [196]o your best, because [201] will be"
  300. 30158 print"keeping your score!":gosub33000
  301. 30160 print"          [206]umber of [208]roblems"
  302. 30162 print"          [163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
  303. 30165 print"    [217]ou will decide how many problems"
  304. 30170 print"to do.  [201]f you choose option 1, you"
  305. 30175 print"may only have 5 problems; otherwise,"
  306. 30180 print"you may have from 5 to 20 problems."
  307. 30185 gosub 33000
  308. 30187 gosub480:ln=1:tx$="[198]ractions to [196]ecimals":gosub 100:gosub800
  309. 30190 tx$="[151] [208]ublished by [214]iking [212]echnologies, [201]nc.":x=0:y=24:gosub 980
  310. 30200 return
  311. 33000 rem *** continue instructions ***
  312. 33005 tx$="[159][169][208]lease [208]ress [193]ny [203]ey[146][169]":y=24:gosub990
  313. 33010 getwe$:ifwe$=""then33010
  314. 33015 ln=5:gosub200:print"":return
  315.