Basic/data/RECHNER.BAS

147 lines
3.3 KiB
QBasic
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

10 COL 0,$56,0
20 CROFF
30 CLS
35 MOUSE 1,0
40 FRAME 0,$FC,$56,0,0,39,4
50 WIN 1,255,0,0,1,1,38,3,0
60 WIN 2,0,$56,0,0,5,39,29,1
70 COL 255,$56,0
80 TLOAD 1,"rechner.dat",16,11
90 STILE 1
100 BUTTON 1,$a8,1,6,0,"LN "
110 BUTTON 2,$a8,6,6,0,"LOG"
120 BUTTON 3,$a8,11,6,0,"FRC"
130 BUTTON 4,$a8,16,6,0,"MOD"
140 BUTTON 5,$a8,23,6,0,"MC"
150 BUTTON 6,$a8,27,6,0,"MR"
160 BUTTON 7,$a8,31,6,0,"M+"
170 BUTTON 8,$a8,35,6,0,"M-"
180 BUTTON 9,$a8,1,9,0,"MIN"
190 BUTTON 10,$a8,6,9,0,"MAX"
200 BUTTON 11,$a8,11,9,0,"INT"
210 BUTTON 12,$a8,16,9,0,"EXP"
220 BUTTON 13,$a8,1,12,0,"SIN"
230 BUTTON 14,$a8,6,12,0,"COS"
240 BUTTON 15,$a8,11,12,0,"TAN"
250 BUTTON 16,$a8,16,12,0,"COT"
340 BUTTON 25,$e8,1,22,0,"x"
350 BUTTON 26,$e8,5,22,0,"e^"
360 BUTTON 28,$e8,9,22,0," "
370 BUTTON 29,$e8,13,22,0,"\\"
373 #a="x"
374 #b=CHR$ (16)
375 #c=#a+#b
380 BUTTON 30,$e8,17,22,0,#c
500 BUTTON 34,$f8,23,10,0," C "
510 BUTTON 35,$f8,31,10,0," AC "
520 BUTTON 36,$3c,23,14,0,"7"
530 BUTTON 37,$3c,26,14,0,"8"
540 BUTTON 38,$3c,29,14,0,"9"
550 BUTTON 39,$3c,23,17,0,"4"
560 BUTTON 40,$3c,26,17,0,"5"
570 BUTTON 41,$3c,29,17,0,"6"
580 BUTTON 42,$3c,23,20,0,"1"
590 BUTTON 43,$3c,26,20,0,"2"
600 BUTTON 44,$3c,29,20,0,"3"
610 BUTTON 45,$3c,23,23,0,"0"
620 BUTTON 46,$3c,26,23,0,","
625 #a=CHR$ (35)
630 BUTTON 47,$3c,29,23,0,#a
635 #a=CHR$ (39)
640 BUTTON 48,$3c,32,14,0,#a
650 BUTTON 49,$3c,32,17,0,"*"
660 BUTTON 50,$3c,32,20,0,"-"
670 BUTTON 51,$3c,32,23,0,"+"
680 BUTTON 52,$3c,23,26,0,"E N T E R!"
1000 WSET 1
1010 HOME
1020 PRINT b;
1030 #a=""
1040 #b=""
1050 #c=""
1060 z=0
1100 a=MB 0
1200 IF a=42 THEN #a="1"
1210 IF a=43 THEN #a="2"
1220 IF a=44 THEN #a="3"
1230 IF a=39 THEN #a="4"
1240 IF a=40 THEN #a="5"
1250 IF a=41 THEN #a="6"
1260 IF a=36 THEN #a="7"
1270 IF a=37 THEN #a="8"
1280 IF a=38 THEN #a="9"
1290 IF a=45 THEN #a="0"
1300 IF a=46 THEN #a="."
1310 IF a=46 THEN p=p+1
1320 IF a>35 AND a<47 THEN o(1)=0
1400 IF a=48 THEN GOSUB 3000:REM Division
1410 IF a=49 THEN GOSUB 4000:REM Multiplikation
1420 IF a=50 THEN GOSUB 5000:REM Minus
1430 IF a=51 THEN GOSUB 6000:REM plus
1440 IF a=52 THEN GOTO 50000
1450 IF a=35 THEN GOSUB 7000:REM AC
1800 IF a>0 AND a<255 THEN GOSUB 2000
1900 GOTO 1100
2000 REM Werteausgabe
2070 IF o(1)=1 THEN RETURN
2080 z=z+1:REM zeichenzaehler
2090 x=ASC (#a)
2095 IF x=46 AND p>1 THEN GOTO 2990
2100 #c=#a
2200 #b=#b+#a
2890 IF z=1 THEN CLS :REM erstes Zeichen
2900 PRINT #c;
2990 RETURN
3000 REM Division
3100 z=0:a(1)=VAL (#b)
3200 o=1
3300 o(1)=1:REM operatortaste gedrueckt
3400 p=0
3500 #a=""
3510 #b=""
3520 #c=""
3990 RETURN
4000 REM Multiplikation
4100 z=0:a(1)=VAL (#b)
4200 o=2
4300 o(1)=1
4400 p=0
4500 #a=""
4510 #b=""
4520 #c=""
4990 RETURN
5000 REM minus
5100 z=0:a(1)=VAL (#b)
5200 o=3
5300 o(1)=1
5400 p=0
5500 #a=""
5510 #b=""
5520 #c=""
5990 RETURN
6000 REM Plus
6100 z=0:a(1)=VAL (#b)
6200 o=4
6300 o(1)=1
6400 p=0
6500 #a=""
6510 #b=""
6520 #c=""
6990 RETURN
7000 REM AC-Taste
7100 CLEAR
7110 CLS
7120 PRINT "0";
7990 RETURN
50000 REM Enter
50100 z=0:a(2)=VAL (#b)
50200 IF o=1 THEN a(3)=a(1)/a(2)
50300 IF o=2 THEN a(3)=a(1)*a(2)
50400 IF o=3 THEN a(3)=a(1)-a(2)
50500 IF o=4 THEN a(3)=a(1)+a(2)
59000 CLS
59100 PRINT a(3);
59200 a(1)=a(3)
59900 GOTO 1100