home *** CD-ROM | disk | FTP | other *** search
/ UpTime Volume 2 #5 / utv2n5s2.d64 / vision.exe (.txt) < prev   
Commodore BASIC  |  2022-08-28  |  11KB  |  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 *