mirror of
https://github.com/mbirth/gwbasic.git
synced 2024-11-09 23:06:45 +00:00
60 lines
2.0 KiB
QBasic
60 lines
2.0 KiB
QBasic
10 DIM TIR(100)
|
||
20 STP=50
|
||
30 CLS
|
||
40 COLOR 15
|
||
50 LOCATE 1,31:PRINT"K<>rzen von Br<42>chen"
|
||
60 KEY OFF:LOCATE 25,1:PRINT"Z„hler eingeben";
|
||
70 LOCATE 3,1:INPUT"",ZHL
|
||
80 IF ZHL=INT(ZHL) THEN 90 ELSE GOTO 70
|
||
90 LOCATE 25,1:PRINT"Nenner eingeben";
|
||
100 LOCATE 5,1:INPUT"",NENN
|
||
110 IF NENN=INT(NENN) THEN 120 ELSE GOTO 100
|
||
120 IF NENN<>0 THEN GOTO 130 ELSE GOTO 100
|
||
130 IF LEN(STR$(ZHL))>LEN(STR$(NENN)) THEN Y=LEN(STR$(ZHL)) ELSE Y=LEN(STR$(NENN))
|
||
140 LOCATE 4,1:FOR Z=1 TO Y-1:PRINT"Ä";:NEXT Z
|
||
150 MINU=VAL(MID$(TIME$,4,2)):SEC=VAL(RIGHT$(TIME$,2)):TI=MINU+(SEC/100)/.6
|
||
160 LOCATE 25,1:COLOR 31:PRINT"Berechne... ";:COLOR 15
|
||
170 LOCATE 24,13:PRINT"X % Zeit Berechn 0% 50% 100%";:COLOR 8
|
||
180 LOCATE 25,38:PRINT"ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ";:COLOR 15
|
||
190 IF ZHL<NENN THEN MAX=NENN:MIN=ZHL ELSE MAX=ZHL:MIN=NENN
|
||
200 FOR X=1 TO MIN
|
||
210 QUOT=X*MAX/MIN
|
||
220 PROZ=X/MIN
|
||
230 MIND=VAL(MID$(TIME$,4,2)):SECD=VAL(RIGHT$(TIME$,2)):TID=MIND+(SECD/100)/.6
|
||
240 TIDIFF=TID-TI:MN=INT(TIDIFF):SC=(TIDIFF-MN)*100*.6
|
||
250 NOW=NOW+1
|
||
260 TIR(NOW)=TIDIFF/PROZ
|
||
270 IF NOW=STP THEN NOW=0 ELSE GOTO 320
|
||
280 FOR NUMM=1 TO STP
|
||
290 TIR=TIR+TIR(NUMM)
|
||
300 NEXT NUMM
|
||
305 TIR=TIR/STP
|
||
310 BM=INT(TIR):BS=((TIR)-BM)*100*.6
|
||
320 LOCATE 25,23:PRINT USING"##:## ##:##";MN;SC;BM;BS;
|
||
330 GOSUB 470
|
||
340 LOCATE 25,12:PRINT X;
|
||
350 LOCATE 25,18:PRINT INT(PROZ*100);
|
||
360 IF QUOT=INT(QUOT) THEN 380
|
||
370 NEXT X
|
||
380 GGT=MIN/X
|
||
390 LOCATE 7,1:PRINT"gek<65>rzter Bruch:"
|
||
400 LOCATE 9,1:PRINT ZHL/GGT
|
||
410 LOCATE 11,1:PRINT NENN/GGT
|
||
420 IF LEN(STR$(ZHL/GGT))>LEN(STR$(NENN/GGT)) THEN Y=LEN(STR$(ZHL/GGT)) ELSE Y=LEN(STR$(NENN/GGT))
|
||
430 LOCATE 10,2:FOR Z=1 TO Y-1:PRINT"Ä";:NEXT Z
|
||
440 LOCATE 25,1:COLOR 15:PRINT"Fertig! ";
|
||
450 LOCATE 13,1
|
||
460 END
|
||
470 PLUS=INT(PROZ/.025)
|
||
480 ZEI=INT(PROZ/.0125)
|
||
490 LOCATE 25,38+PLUS
|
||
500 IF PLUS<=19 THEN W=10
|
||
510 IF PLUS>19 AND PLUS<=32 THEN W=14
|
||
520 IF PLUS>32 THEN W=12
|
||
530 COLOR W
|
||
540 IF ZEI/2=INT(ZEI/2) THEN ZEI$="Ý" ELSE ZEI$="Û"
|
||
550 IF PROZ=1 THEN ZEI$=" "
|
||
560 PRINT ZEI$;
|
||
570 COLOR 15
|
||
580 RETURN
|
||
|