home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
UpTime Volume 2 #5
/
utv2n5s2.d64
/
vision.exe
(
.txt
)
< prev
Wrap
Commodore BASIC
|
2022-08-28
|
11KB
|
315 lines
5 rem **** fractions to decimals ****
10 poke 53280,0:poke 53281,0:print"[147]";
12 poke 45,peek(174):poke 46,peek(175):clr
15 gn$="[198]ractions to [196]ecimals"
17 gosub 5000
20 for z=54272 to 54296:poke z,.:next:ford=1to6:readre$(d):next
25 data "[199]reat!","[198]antastic!","[211]uper!","[217]ou've got it!"
26 data "[217]es! [217]es! [217]es!","[212]hat's [199]reat!"
28 forx=0to7:reada:poke30936+x,a:poke31056+x,peek(29320+x):next
30 data 0,128,192,224,240,224,192,128
40 get a$:ifa$<>" " then 40
95 goto 2000
100 rem *** zippy titles ***
105 rem ln=line# to place text
110 poke646,11:lc=(23-ln)/3
115 tb=(40-len(tx$))/2
120 ford=23tolnstep-1:print"";
125 ford1=1tod:print"";:next
130 ifd/6=int(d/6)then gosub165
135 printtab(tb)tx$
140 next
145 ford=23toln+1step-1:print"";
150 ford1=1tod:print"";:next
155 printtab(11)" "
160 next:return
165 ifpeek(646)=15thenpoke646,1
170 ifpeek(646)=12thenpoke646,15
175 ifpeek(646)=11thenpoke646,12
180 return
200 rem *** clear ***
210 for er=lnto23:poke 781,er:sys 59903:next:return
300 rem
305 rem *** reward sound ***
310 rem
320 poke 53280,2:poke 53281,2
325 s=54272:pokes+24,7:pokes+1,110:pokes+5,9:pokes+6,10:pokes+4,17:pokes+4,16
330 for d=1 to 25:next
332 poke 53280,5:poke 53281,5
335 s=54279:pokes+24,7:pokes+1,110:pokes+5,9:pokes+6,10:pokes+4,17:pokes+4,16
340 for d=1 to 25:next
342 poke 53280,6:poke 53281,6
345 s=54286:pokes+24,7:pokes+1,110:pokes+5,9:pokes+6,10:pokes+4,17:pokes+4,16
350 for d=1 to 25:next
352 poke 53280,0:poke 53281,0
355 sc=sc+1
365 return
400 rem
405 rem *** get numeric input ***
410 j$="":print"[164]";
415 get a$:if a$="" then 415
420 if a$=chr$(13) then print"[157] ":j=val(j$):mx=0:return
425 if a$=chr$(20) and j$="" then 415
430 if a$=chr$(20) then j$=left$(j$,len(j$)-1):print"[157][157] [157][157][164]";:goto 415
433 if a$="[140]" then 470
435 if a$<" " or a$>"[218]" then 415
440 if a$>"z" and a$<"[193]" then 415
445 if a$=chr$(34) then 415
450 if len(j$)=mx then 415
455 print"[157] [157]"a$"[164]";
460 j$=j$+a$:goto 415
470 gosub 480:ln=1:tx$="[197]xit to [213]p[212]ime"
475 gosub 100:gosub 800:goto 4062
480 rem *** print screen header ***
481 print"[147]":poke53287,2:poke53288,12:poke53248,38:poke53249,56:poke 53250,38
482 poke 53251,56
485 forx=0to1:poke53277,peek(53277)or(2^x):poke 53271,peek(53271)or(2^x)
490 poke 53269,peek(53269)or(2^x):next
495 print"":return
499 forx=0to2:poke53269,peek(53269)and(255-2^x):next:return
500 rem ** short wrong sound **
505 wn$="028":s=54272:pokes+6,96:pokes+24,15
510 forq=1to6 step3
515 pokes+1,val(mid$(wn$,q,2)):pokes+4,33
520 forjw=1tot*val(mid$(wn$,q+2,1)):next:forr=1to100:next
525 pokes+4,0:next:return
600 rem
605 rem *** general purpose delay ***
610 rem
615 for qd=1 to 600:next
620 return
800 rem *** title bars ***
805 print"";:
810 print"[159][192][157][157][156][183][183][145][145]";
815 forx=1to23:print"[154][175][157][159][192][157][156][183][145][145]";:next
820 print"[154][175][175][157][157][159][192]":return
850 print"[154]";:goto 855
855 print"";
860 print"[172][192][192][192][192][192][187]"
865 forjw=1to3:print"[221][221]":next
870 print"[173][192][192][192][192][192][189]"
871 ifsf=1andop=4thensf=0:goto874
872 ifop=4thenreturn
874 print"[156][172][192][192][192][192][192][192][192][192][192][192][187]"
876 forjw=1to3:print"[221][221]":next
878 print"[173][192][192][192][192][192][192][192][192][192][192][189]"
880 return
900 rem *** continue or exit ***
902 print"";:ford=1to24:print"";:next
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]"
925 s=54272:pokes+24,7:pokes+1,110:pokes+5,9:pokes+6,10:pokes+4,17:pokes+4,16
930 getrc$:ifrc$=""then930
940 ifrc$="_"thencp=cp+1:goto 4000
950 ifrc$<>chr$(13)then930
960 return
980 print"";:forjg=1toy:print"";:nextjg:printtab(x);tx$;:return
990 x=(40-len(tx$))/2:goto980
1000 rem *** option 2 input ***
1005 nu$=str$(nu)
1010 j$="":ifop=3thenj$="."
1011 fordd=2tolen(nu$):mu=0
1014 tx$="":gosub980
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
1017 print"[146]"
1018 ifop>2thenj$=j$+a$:goto1050
1020 ifa$=mid$(nu$,dd,1)then1045
1035 gosub500:mu=mu+1:ifmu<>3then1014
1045 tx$=mid$(nu$,dd,1):gosub980:x=x+1:next:return
1050 ifop>2anda$=chr$(20)thenx=x-1:tx$=" ":gosub980:dd=dd-2
1051 ifop>2anda$=chr$(20)thenj$=left$(j$,len(j$)-2):next:return
1055 ifop>2thentx$=a$:gosub980:x=x+1:next:return
1100 rem *** wrong sound ***
1105 wn$="042034":s=54272:pokes+6,96:pokes+24,15
1110 forq=1to6 step3
1115 pokes+1,val(mid$(wn$,q,2)):pokes+4,33
1120 forjw=1tot*val(mid$(wn$,q+2,1)):next:forr=1to300:next
1125 pokes+4,0:next:return
2000 rem
2005 rem *** main program ***
2010 rem
2015 gosub480:ln=1:tx$="[198]ractions to [196]ecimals"
2016 print"";:gosub 100:gosub800
2017 tx$="[151] [208]ublished by [211]oftdisk [208]ublishing, [201]nc.":x=0:y=24:gosub 980
2020 x=0:y=10
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] "
2027 tx$=tx$+" [157][157][157][157][157][157][157]":gosub 980
2030 mx=1:gosub400:i$=j$:ifi$="y"thengosub30000
2035 ifi$<>"n"andi$<>"y"thenprint"[145]";:goto2025
2038 ln=5:gosub200
2040 y=10:x=0:tx$="[215]hat is your name? "
2045 gosub 980:mx=20:gosub 400:nn$=j$:gosub200
2050 x=0:y=10:tx$="[215]hich option do you want:"
2053 gosub 980
2055 tx$=" 1. [196]emonstration.":y=12:gosub980
2060 tx$=" 2. [215]ork examples with help.":y=13:gosub980
2065 tx$=" 3. [211]tep-by-step problems.":y=14:gosub980
2068 tx$=" 4. [193]nswers only.":y=15:gosub980
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
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] "
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] "
2073 ifop<>1andop<>2andop<>3andop<>4then2070
2074 tx$="[200]ow many problems? "+np$:y=19:gosub980:mx=2:gosub400:np=j
2075 ifop=1then2078
2076 ifnp<5ornp>20then2074
2077 goto 2079
2078 ifnp<1ornp>5then2074:gosub900
2079 forcp=1tonp:ln=5:gosub200:gosub850
2082 n=int(rnd(1)*8)+1:d=int(rnd(1)*8)+2:an=n/d:ifan>=1then2082
2084 an$=str$(an):iflen(an$)>5andint(rnd(1)*2)+1=1then2082
2086 iflen(an$)>5thenan=val(left$(an$,5))
2088 tx$="[195]hange this fraction":x=0:y=8:gosub980:tx$="to a decimal.":y=9
2090 gosub980:tx$=str$(n):x=30:y=7:gosub980:tx$="[192][192][192]":y=8:x=30:gosub980
2092 tx$=str$(d):y=9:x=30:gosub980
2094 an$=str$(an):d$=str$(d):n$=str$(n)
2096 iflen(an$)=5then2098
2097 fordd=1to(5-len(an$)):an$=an$+"0":next
2098 onopgosub2100,2200,2200,2400:gosub900:nextcp:goto4000
2100 rem *** demonstration ***
2104 gosub 600:gosub600
2105 tx$="[196]ivide the numerator":x=0:y=12:gosub980:gosub600
2110 tx$=n$+"[157][157][221].":y=14:x=26:gosub980:tx$="[176][192][192][192][192][192][192]":y=13:gosub980:gosub600
2120 tx$="by the denominator.":x=0:y=13:gosub980:gosub600
2125 tx$=d$:y=14:x=24:gosub980:gosub600
2130 tx$="[193]dd three zeros after":x=0:y=15:gosub980
2135 tx$="the decimal point.":y=16:gosub980:gosub600
2140 forx=29to31:y=14:tx$="0":fordd=1to200:next:gosub980:next
2145 tx$="[208]lace the decimal point for the answer.":x=0:y=18:gosub980:gosub600
2150 tx$=".":y=12:x=28:gosub980:gosub600
2155 tx$="[206]ow divide.":x=0:y=20:gosub980:gosub600
2160 fordd=3tolen(an$):tx$=mid$(an$,dd,1):x=26+dd:y=12:gosub980
2165 forbb=1to200:next:next
2167 ifsy=1thensy=0:op=1
2170 return
2200 rem *