home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1992 January
/
1992-01.d64
/
calc.machine
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
16KB
|
542 lines
0 clr
10 rem copyright 1992 - compute publications intl ltd - all rights reserved
100 dims1$(30),c1$(20),rm(25),rm$(25),u$(35),u(20),m1$(24)
105 p=950:t=6:l1=8:md=3:gd=1
110 data32,155,183,134,251,32,155,183,138,168,166,251,24,76,240,255
120 data"scientific",2,"conversion",13,"calender ",24,"info",34
130 data"calculator",2,"& reverse.",13,"memo pad.",24,"v4.1",34
140 data"sine ","cos. ","tan. ","arc-sine","arc-cos."
145 data"arc-tan.","x^2 ","x^y ","perm...n","comb...n"
150 data"1/x ","x! ","sqr ","x^(1/y) ","m o d e "
155 data"log. ","anti-log","ln. ","anti-ln.","l.c.m. ","g.c.f. "
157 data"factor ","memory +","memory -","m.recal ","m.clear "
158 data"add (+) ","subtract","multiply","divide "
160 data"cm. in.","km. mile","m. yrd.","m2 yrd2","m2 sft"
165 data"m3 cft","mrla sft","hctr acr","lit gal","lit pnt"
170 data"kg. lb.","grm oz.","seer kg.","mtn ltn","wth btu"
175 data"kw. hp.","dec bsn","dec dms","dec romn","[188]c [188]f"
180 data1000,m,1000,m,1000,m,900,cm,500,d,400,cd,100,c,100,c,100,c,90,xc,50,l
182 data40,xl,10,x,10,x,10,x,9,ix,5,v,4,iv,1,i,1,i,1,i
190 fori=0to15:readb:pokep+i,b:next
191 poke53281,0:poke53280,0:printchr$(8)"[147]":gosub380
192 sysp,22,20:print" please wait ":gosub1700
193 fori=1to8:readm$(i),m(i):next
195 fori=1to30:reads1$(i):next
197 fori=1to20:readc1$(i):next
198 fori=1to21:readrm(i),rm$(i):next
200 datainch,mile,yard,square yard,square ft.,cubic ft.,square ft.,acre
202 datagallon,pint,pound,ounce,kilogram,long ton,b.t.u.,horse power
204 datacentimeter,kilometer,meter,square meter,square meter,cubic meter,merla
206 datahectare,liter,liter,kilogram,gram,seer,metric ton,watt hour,kilowatt
208 data2.54,1.60934,.9144,.8361,.0929,.02832,.00444444
210 data.40469,4.54609,.56826,.45359,28.35,1.072,1.016,.293,.7457
212 fori=1to32:readu$(i):next
214 fori=1to16:readu(i):next
216 data january,31,febuary,28,march,31,april,30,may,31,june,30,july,31
217 data august,31,september,30,october,31,november,30,december,31
218 fori=1to24:readm1$(i):next
224 r1$="[150]":r2$="":r3$="":r5$="[154]":r6$="[158]":r7$="[156]":r8$=""
226 md$(1)=" radian ":md$(2)=" grade ":md$(3)=" degree "
228 sysp,22,20:print" "
230 geta$:ifa$=""thengosub520
240 ift=3thenr4$=r1$:goto310
250 ifa$=chr$(13)then550
260 ifa$="_"thenrun
270 ifa$=""thenc1=c1+1
280 ifa$="[157]"thenc1=c1-1
290 ifc1<1thenc1=4
300 ifc1>4thenc1=1
310 gosub340
320 r4$=r2$:t=9-t:ift=6then250
330 goto230
340 ifc1=4andt=3thenr4$=r3$
350 sysp,2,m(c1):printr4$;m$(c1)
360 sysp,3,m(c1):printr4$;m$(c1+4)
370 return
380 print"[213][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178]";
385 print"[178][178][178][178][178][178][178][178][178][178][178][178][178][178][201][171][219][177][177][177][177][177][177][177][177]";
390 print"[177][177][219][177][177][177][177][177][177][177][177][177][177][219][177][177][177][177][177][177][177][177][177][219][177]";
395 print"[177][177][177][219][179][171][179][150]scientific[221][150]convers";
400 print"ion[221][150]calendar [221]info[171][179][171][179][150]cal";
405 print"culator[221][150]& reverse.[221][150]memo p";
410 print"ad.[221]v4.1[171][179][171][219][178][178][178][178][178][178][178][178][178][178][219][178][178]";
415 print"[178][178][178][178][178][178][178][178][219][178][178][178][178][178][178][178][178][178][219][178][178][178][178][219][179]";
420 print"[202][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177]";
425 print"[177][177][177][177][177][177][177][177][177][177][177][177][177][177][203]"
480 sysp,21,2:print"[213][192][192][192][192][192][192][192][192][201]"
490 sysp,22,2:print"[221] [221]"
500 sysp,23,2:print"[202][192][192][192][192][192][192][192][192][203]"
510 sysp,24,2:print"crsr[146] hi-light return[146] select _[146] reset";:return
520 tm$=left$(ti$,2)+":"+mid$(ti$,3,2)+":"+right$(ti$,2)
530 sysp,22,3:printtm$
540 return
550 onc1gosub570,6000,8000,1700
560 t=6:gosub380:goto230
570 x2=21:t=5:lr=3:cb=1:cn=0
575 sysp,4,2:print"[154][176][192][192][192][192][192][192][192][192][178][192][192][192][192][192][192][192][192][178][192][192][174]"
580 sysp,5,2:print"[221]sin. [221]log. [221][159]f1[154][221]"
590 sysp,6,2:print"[221]cos. [221]anti-log[221] [221]"
600 sysp,7,2:print"[221]tan. [221]ln. [221]f [221]"
610 sysp,8,2:print"[221]arc-sin.[221]anti-ln.[221]o [221]"
620 sysp,9,2:print"[221]arc-cos.[221]l.c.m. [221]r [221]"
630 sysp,10,2:print"[221]arc-tan.[221]g.c.f. [221] [221]"
640 sysp,11,2:print"[221]x^2 [221]factor [221]m [221]"
650 sysp,12,2:print"[221]x^y [221]memory +[221]a [221]"
660 sysp,13,2:print"[221]perm...n[221]memory -[221]i [221]"
670 sysp,14,2:print"[221]comb...n[221]m.recal [221]n [221]"
672 sysp,15,2:print"[221]1/x [221]m.clear [221] [221]"
674 sysp,16,2:print"[221]x! [221]add (+) [221]m [221]"
676 sysp,17,2:print"[221]sqr [221]subtract[221]e [221]"
678 sysp,18,2:print"[221]x^(1/y) [221]multiply[221]n [221]"
679 sysp,19,2:print"[221][158]m o d e [154][221]divide [221]u [221]"
680 sysp,20,2:print"[173][192][192][192][192][192][192][192][192][177][192][192][192][192][192][192][192][192][177][192][192][189]":pc=0
690 geta$:ifa$=""thengosub520
700 ift=2thenr4$=r5$:goto770
710 ifa$=chr$(13)then815
715 ifa$="[133]"thenreturn
720 ifa$="_"thenrun
730 ifa$=""thencb=cb+1:gosub2050
740 ifa$="[145]"thencb=cb-1:gosub2050
742 ifa$=""ora$="[157]"thenlr=15-lr:gosub2050
750 ifcb<1thencb=15:lr=15-lr
760 ifcb>15thencb=1:lr=15-lr
770 gosub795
780 r4$=r2$:t=7-t:ift=5then710
790 goto690
795 c3=cb:iflr=12thenc3=cb+15
800 sysp,cb+4,lr:printr4$;s1$(c3)
810 return
815 x=lr:y=cb+5
820 onc3gosub 850,900,950,1000,1050,1100,1150,1200,1250,1300,1350,1400,1450,1500
825 ifc3<14then845
830 onc3-14gosub1550,1600,1650,2500,2600,2700,2800,2900,3000,3100,3200,3300,3400
835 ifc3<27then845
840 onc3-27gosub3500,3600,3700
845 goto575
850 gosub2200
860 an=sin(in*(NULL)/d1)
870 goto5000
900 gosub2200
910 an=cos(in*(NULL)/d1)
920 goto5000
950 gosub2200
960 an=tan(in*(NULL)/d1)
970 goto5000
1000 gosub2200
1020 an=atn(in/sqr(-in*in+1))*(d1/(NULL))
1045 goto5000
1050 gosub2200
1060 ifmd=1thend1=(NULL)
1070 an=(-atn(in/sqr(-in*in+1))+(NULL)/2)*(d1/(NULL))
1095 goto5000
1100 gosub2200
1120 an=atn(in)*(d1/(NULL))
1145 goto5000
1150 gosub2200:an=in^2
1195 goto5000
1200 gosub1860:print"value of x= ";:gosub1910:i1=val(s$)
1210 x=x+2:y=y+2:gosub1860:print"value of y= ";:gosub1910:i2=val(s$)
1220 an=i1^i2
1245 goto5000
1250 gosub1860:print"[159]value of n= ";:gosub1910:i1=val(s$)
1252 x=x+2:y=y+2:gosub1860:print"[159]value of r= ";:gosub1910:i2=val(s$)
1260 pc=1:in=i1:gosub1410:nf=an:in=i2:gosub1410:rf=an
1270 in=i1-i2:gosub1410:ff=an
1280 np=nf/ff:nc=np/rf
1290 an=np:ifcb=10thenan=nc
1295 goto5000
1300 goto1250
1350 gosub2200
1360 an=1/in
1395 goto5000
1400 gosub2200
1410 an=1:fori=1toin:an=an*i:next
1415 ifpc=1thenreturn
1445 goto5000
1450 gosub2200
1460 an=sqr(in)
1495 goto5000
1500 x=10:y=18:gosub1860:print"[129]value of x= ";:gosub1910:i1=val(s$)
1510 x=x+2:y=y+2:gosub1860:print"[129]value of y= ";:gosub1910:i2=val(s$)
1520 an=i1^(1/i2)
1545 goto5000
1550 gosub4000
1551 geta$:ifa$=""thengosub520
1552 ift1=2thenr4$=r8$:goto1566
1554 ifa$=chr$(13)thenreturn
1556 ifa$=""thenmd=md+1:gosub2050
1558 ifa$="[145]"thenmd=md-1:gosub2050
1560 ifmd<1thenmd=3
1562 ifmd>3thenmd=1
1566 gosub1572
1568 r4$=r1$:t1=7-t1:ift1=5then1554
1570 goto1551
1572 sysp,md+18,14:printr4$;md$(md)
1574 return
1600 gosub2200
1610 an=log(in)/log(10)
1645 goto5000
1650 gosub2200
1660 an=10^in
1695 goto5000
1700 gosub2040:x=5:y=8:sysp,y,x:print"[176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174]"
1710 sysp,y+1,x:print"[221][207][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][208][221]"
1720 sysp,y+2,x:print"[221][180][158] calculating machine v4.1 [170][221]"
1730 sysp,y+3,x:print"