1
0
mirror of https://github.com/mbirth/gwbasic.git synced 2024-11-09 23:06:45 +00:00
gwbasic/OHM.BAS

35 lines
1.1 KiB
QBasic
Raw Normal View History

1996-05-08 23:59:20 +01:00
10 CLS:KEY OFF
20 FOR I=0 TO 12:READ A$,A:COLOR A:PRINT I;A$,;:NEXT I
30 PRINT:PRINT:COLOR 5:PRINT" 1.2.3. 4."
40 PRINT" \ \ \ \
50 PRINT"--";
60 FOR I=1 TO 9:PRINT CHR$(219);:NEXT I
70 PRINT"--":COLOR 15,8
80 DATA "SCHWARZ",8,"BRAUN",6,"ROT",4
90 DATA "ORANGE",12,"GELB",14,"GR<47>N",10,"BLAU",09
100 DATA "VIOLETT",13,"GRAU",7,"WEISS",15
110 DATA "ohne",5,"GOLD",14,"SILBER",7
120 PRINT:FOR R=1 TO 2:GOSUB 270
130 IF R=1 THEN Y=A*10 ELSE Y=A*1
140 X=X+Y:NEXT R:R=3:GOSUB 270
150 IF A<7 THEN X=X*10^A
160 IF A=11 THEN X=X/10
170 IF A=12 THEN X=X/100
180 R=4:GOSUB 270:T=A
190 IF A=10 THEN T=20
200 IF A=11 THEN T=5
210 IF A=12 THEN T=10
220 LOCATE 13,1:IF X<9999999! THEN PRINT X" Ohm
230 IF X>1000 THEN PRINT X/1000;" Kilo Ohm
240 PRINT"Toleranz: "T"% = "X/100*T" Ohm
250 INPUT"Nochmal (j/n)";A$
260 IF A$="n" THEN KEY ON:END ELSE RUN
270 LOCATE 9,1
280 PRINT"Farbe vom "R". Ring.":INPUT A
290 LOCATE 9,21
300 PRINT" ":IF A<0 OR A>12 THEN 270
310 LOCATE 7,1+R*2:IF R=4 THEN LOCATE 7,10
320 RESTORE:FOR I=0 TO A:READ A$,F:NEXT I
330 COLOR F,5
340 PRINT CHR$(222):COLOR 15,8:RETURN