home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
UpTime Volume 2 #8
/
utv2n8s2.d64
/
CO
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-28
|
8KB
|
262 lines
1 if ru<>1 then clr:rem compare 1/20/88
10 poke53280,0:poke53281,0
15 a1=1
17 c1$="[164][157]" : c2$=" [157]" : c%=0 : i$="" : no% = 0
20 dims(9),s$(11),se$(11),nu$(10,3),an$(3),an(3)
100 gosub 7000:printchr$(14)
105 gosub10000
110 gosub480
250 goto 2000
300 n=n+1:rem if z=5 then n=n+1
310 rw=int(rnd(0)*6)+1:for j=1 to 4:gosub920:delay=.3:gosub940
330 tx$=chr$(co(j))+rw$(rw)+chr$(5):gosub 990:gosub 610:delay=.2:gosub 940
340 nextj:return
400 rem *** get character ***
410 geta$:ifa$=""then410
411 return
420 gosub 400:a=val(a$):ifa<loora>hithen420
421 return
480 print"[147]"
481 h=10:tx$="[214][201][211][201][207][206][160][211][207][198][212][215][193][210][197] presents:":v=1:gosub 600
482 tx$="[195]omparing [198]ractions"
483 print"";:h=10:v=3:gosub 600
484 print"";:print:gosub 800:return
490 print chr$(142): rem *** print screen header ***
491 print"[147]"
492 tx$="vision software presents:":h=10:v=1:gosub 610:tx$=t$
493 print"";:h=10:v=3:gosub 610
494 print"";:print:gosub 800:return
500 rem **** remove leading spaces ****
510 l=len(sp$):ifleft$(sp$,1)<>" "thengoto530
520 l=l-1:sp$=right$(sp$,l)
530 return
600 rem *** hor/ver tab ***
610 vt$="":forq=1tov
620 :vt$=vt$+"":next q
630 print"";vt$;:printtab(h);tx$;:return
800 print"";:for q=1 to 40
810 :print"[192]";:next q:print"";:return
830 tx$="[159]"+"[182][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][161]":v=v2:gosub610
835 forl=1to8:tx$="[182] [161]":v=v+1:gosub610:nextl
840 tx$="[182][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][161]"+"":v=v+1:gosub610:return
850 n1=7:ifno<7thenn1=12:ifno=5thenn1=10
855 v=v1:tx$=cl$+" [183][183][183][183]":gosub610:forl=1ton1:tx$="[170] [180]"+"":v=v-1:gosub610
860 nextl:return
880 tx$="[162][162][162][162][162]":gosub 610:return
900 v=24:tx$=" <return> to continue, <_> to exit[146]":gosub 990:gosub 610
901 lo=0:gosub400:if a$="_" then 4000
902 ifa$<>chr$(13) then 900
903 return
910 v=24:tx$=" <[210][197][212][213][210][206]> to continue, <_> to exit[146]":gosub 990:gosub 610
911 lo=0:gosub400:if a$="_" then 4000
912 ifa$<>chr$(13) then 910
913 return
920 h=0:tx$=" ":gosub 610:return
940 ti$="000000"
941 geta$:ifa$<>""then943
942 ifti/60<delaythen941
943 return
990 ln=len(tx$):h=(40-ln)/2:return
1000 forjj=1to2:nu(jj)=int(rnd(1)*9)+1
1001 den(jj)=int(rnd(1)*9)+1:ifden(jj)<nu(jj)orden(jj)=nu(jj)then1000
1010 an(jj)=nu(jj)/den(jj):nextjj:ifabs(an(1)-an(2))<.1then1000
1020 an=1:ifan(2)>an(1)thenan=2
1030 sh$=sh$(int(rnd(1)*5)+1):forl=1to3:cr$(l)=chr$(co(int(rnd(1)*4)+1)):nextl
1040 da$=str$(den(an)):na$=str$(nu(an)):sp$=da$:gosub500:da$=sp$:sp$=na$
1050 gosub500:na$=sp$:an$=na$+"/"+da$
1060 cl$=chr$(5)
1090 return
1100 rem write numbers
1110 for j=1 to 3:v=v1+j:h=h1:tx$=cl$+nu$(iq,j)+"":gosub 610:next j :return
1400 rem **** draw bar graph ****
1405 n2=1:ifno<7thenn2=int(12/no)
1410 gosub850:v=v1:forl=1tono:tx$=cl$+"[167][183][183][183][183][165]":v=v-n2:gosub610:nextl
1420 y=3:h=h+1:v=v1:forl=1tonu:forj=1ton2
1450 tx$=chr$(co(y))+" [146]"+"":v=v-1:gosub610:nextj:ify=2theny=3:goto1470
1460 y=2:nextl:return
1470 nextl:return
2000 if ru=1 then 2035
2010 h=0:v=10:tx$="[196]o you need a lesson? ":gosub 600:lo=0:gosub 400
2020 ifa$="y"ora$="[217]"thenprinta$: gosub20000:goto 2035
2021 if a$="n" or a$="[206]" thenprinta$:goto2030
2022 a$="":goto 2010
2030 tx$=" ":v=10:h=0:gosub600
2035 h=0:v=7:tx$="[215]hat's your first name? ":gosub610
2036 mx%=20:i$="":gosub60000:nf$=i$
2037 if nf$="" then 2035
2040 h=0:v=9:tx$="[215]hat's your last name? ":gosub600
2041 mx%=20:i$="":gosub60000:nl$=i$
2045 v=11:h=0:tx$="[215]ould you like to: ":gosub600
2048 h=7:v=13:fori=1to3:tx$=str$(i)+". "+op$(i):gosub 610:v=v+1:next i
2050 lo=1:hi=3:tx$="[217]our choice: (1-3) ":h=0:v=v+1:gosub 610:gosub 420:printa$
2060 op=a:hi=20:if op=1then hi=5
2065 v=19:h=0:tx$="[200]ow many problems do you want":gosub 610
2070 v=20:tx$="to do? (1 -"+str$(hi)+") [157][157]" :gosub 610
2072 mx%=2:no%=1:i$="":gosub60000:np=val(i$)
2075 ifnp<loornp>hithen np=0 :goto2065
2110 fork=1tonp
2120 gosub 1000:gosub 490:tx$="compare these fractions:":v=6:h=2:gosub 610
2125 v2=8:h=8:gosub830:iq=den(1):v1=13:h1=12:gosub1100:iq=nu(1):v1=8:h1=12
2126 gosub1100:v=12:h=11:gosub880:iq=den(2):v1=13:h1=22:gosub1100:iq=nu(2):v1=8
2127 h1=22:gosub1100:h=21:v=12:gosub880
2130 onopgosub2200,2300,2400
2150 gosub900:nextk:goto4000
2200 rem **** op 1 ****
2210 cl$=cr$(1):ns=den(1):v1=7:h=4:cl$=cr$(2):ns=den(2):v1=7:h=35
2230 cl$="":v1=20:h=1:no=den(1):nu=nu(1):gosub1400:h=32:nu=nu(2):no=den(2)
2240 gosub1400:tx$=an$+" is larger.":v=19:gosub990:gosub610
2250 cl$=cr$(3):iq=nu(an):v1=8:h1=12:ifan=2thenh1=22
2290 gosub1100:iq=den(an):v1=13:gosub1100:return
2300 rem **** op 2 ****
2310 cl$="":v1=20:h=1:no=den(1):nu=nu(1):gosub1400:h=32:nu=nu(2):no=den(2)
2315 gosub1400:tx$="1.":v=9:h=10:gosub610:tx$="2.":v=9:h=20:gosub610
2320 tx$="which is larger (1 or 2)? ":v=22:h=6:gosub610
2322 mx%=1:no%=1:i$="":gosub60000:aa=val(i$):delay=1:gosub940
2325 ifaa=anthengosub300:goto2335
2330 v=22:gosub920:tx$=an$+" is the larger fraction.":v=22:gosub990:gosub610
2335 cl$=cr$(3):iq=nu(an):v1=8:h1=12:ifan=2thenh1=22
2340 gosub1100:iq=den(an):v1=13:gosub1100:return
2345 v=22:gosub920
2399 return
2400 rem **** op 3 ****
2410 tx$="1.":v=9:h=10:gosub610:tx$="2.":v=9:h=20:gosub610
2415 tx$="which is larger (1 or 2)? ":v=22:h=6:gosub610
2417 mx%=1:no%=1:i$="":gosub60000:aa=val(i$):delay=1:gosub940
2420 g=g+1:ifaa=anthengosub300:goto2435
2425 v=22:gosub920:tx$=an$+" is the larger fraction.":v=22:gosub990:gosub610
2430 mi=mi+1
2435 delay=1:gosub940:cl$=cr$(3):iq=nu(an):v1=8:h1=12:ifan=2thenh1=22
2440 gosub1100:iq=den(an):v1=13:gosub1100
2445 v=22:gosub920
2450 cl$="":v1=20:h=1:no=den(1):nu=nu(1):gosub1400:h=32:nu=nu(2):no=den(2)
2455 gosub1400
2495 return
3366 stop
4000 print chr$(14):gosub 480:if op<>3 then 4100
4005 v=10:h=0:tx$="[217]ou got"+str$(n)+" right out of"+str$(g)+" problems"
4010 gosub 610:v=12:tx$="for "+str$(int((n/g)*100))+"%."
4020 gosub610:delay=3:gosub 940
4100 h=0:v=15:tx$="[196]o you want to play again? " :gosub 610
4120 lo=0:gosub400 :printa$:if a$="y" or a$="[217]" then clr:ru=1 :goto 1
4130 if a$="n" or a$="[206]" then 4150
4140 goto 4120
4150 clr:poke53269,0:load"menu",8
4200 stop
5390 return
7000 rem *** read data ***
7010 readt$:for i=1 to 6:read rw$(i):next i
7020 fori=1to3:read op$(i):next i:for i=1 to 4:read co(i):next i
7030 fori=0to9:forj=1to3:readnu$(i,j):nextj:nexti
7040 forl=1to5:readsh$(l):nextl:return
8000 rem *** program data ***
8010 data"comparing fractions"
8020 data"great!","fantastic!","super!"
8030 data"you're really going now!","yes! yes! yes!","that's great!"
8040 data"[211]ee examples done."
8050 data"[196]o problems with help."
8060 data"[196]o problems yourself."
8070 data 30,28,31,158
8075 data"[213][195][201]"
8076 data"[221] [221]"
8077 data"[202][195][203]"
8080 data" [174] "," [221] "," [177][160]"
8090 data"[213][195][201]","[213][195][203]","[173][195][189]"
8100 data"[213][195][201]"," [195][179]","[202][195][203]"
8110 data"[176] [176]","[173][195][179]"
8115 data" [177]"
8120 data"[176][195][174]","[173][195][201]","[202][195][203]"
8130 data"[213][195][201]","[171][195][201]","[202][195][203]"
8140 data"[176][195][174]"," [221]"
8145 data" [177]"
8150 data"[213][195][201]","[171][195][179]","[202][195][203]"
8160 data"[213][195][201]","[202][195][179]","[202][195][203]"
8170 data"[193]","[211]","[218]","[216]","[209]"
10000 rem *** do spritey things ***
10001 for i=704 to 767
10002 readx:pokei,x
10003 next
10004 poke2040,11
10005 poke53269,peek(53269)or1
10006 poke53287,2:poke53277,255:poke53271,255
10007 poke53248,30:poke53249,58
10008 return
10009 data252,252,252,121,249,248,51,243,240
10010 data7,231,224,15,207,192,7,159,128
10011 data3,63,0,0,126,0,0,252,0
10012 data0,120,0,0,48,0,0,0,0
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
20000 rem *** info info info ***
20001 gosub480:v=6:readn:for i=1 to n:read tx$
20