mirror of
https://github.com/mbirth/gwbasic.git
synced 2024-11-09 23:06:45 +00:00
257 lines
12 KiB
QBasic
257 lines
12 KiB
QBasic
5 FLE$="COMPI.CFG"
|
||
10 CLS
|
||
20 KEY OFF
|
||
30 CO=10
|
||
40 OF=8
|
||
50 PIN=14
|
||
60 BR=15
|
||
70 A=2:B=2:C=2:D=2:E=2:F=2:G=2
|
||
80 H=2:I=2:J=2:K=2:L=2:M=2:N=2
|
||
90 TUR=0
|
||
100 REM Anzeigeroutine
|
||
110 COLOR 15:LOCATE 5,30:PRINT"W - Werte speichern [";FLE$;"]"
|
||
120 LOCATE 6,30:PRINT"R - Werte laden [";FLE$;"]"
|
||
130 LOCATE 7,30:PRINT"S - Datei „ndern (momentan: ";FLE$;")"
|
||
140 LOCATE 8,30:PRINT"Q - Werte zur<75>cksetzen"
|
||
150 LOCATE 9,30:PRINT"Z - Zufallswerte setzen"
|
||
160 LOCATE 10,30:PRINT"T - TURBO AN/AUS"
|
||
170 LOCATE 11,30:PRINT"U - m”gliche Dateinamen"
|
||
180 LOCATE 12,30:PRINT"A-N - Werte einzeln „ndern"
|
||
190 LOCATE 13,30:PRINT"^/ø - EXIT TO DOS"
|
||
200 LOCATE 14,30:PRINT"[SPCE]- alle Werte „ndern"
|
||
210 LOCATE 1,2:IF A=1 THEN COLOR BR:PRINT"Û" ELSE COLOR PIN:PRINT"o"
|
||
220 LOCATE 2,1:IF A=2 THEN COLOR BR:PRINT"ÛÛ" ELSE IF A=0 THEN COLOR PIN:PRINT"oo" ELSE COLOR PIN:PRINT"o";:COLOR BR:PRINT"Û"
|
||
230 LOCATE 3,2:IF A=3 THEN COLOR BR:PRINT"Û" ELSE COLOR PIN:PRINT"o"
|
||
240 LOCATE 1,4:IF B=1 THEN COLOR BR:PRINT"Û" ELSE COLOR PIN:PRINT"o"
|
||
250 LOCATE 2,3:IF B=2 THEN COLOR BR:PRINT"ÛÛ" ELSE IF B=0 THEN COLOR PIN:PRINT"oo" ELSE COLOR PIN:PRINT"o";:COLOR BR:PRINT"Û"
|
||
260 LOCATE 3,4:IF B=3 THEN COLOR BR:PRINT"Û" ELSE COLOR PIN:PRINT"o"
|
||
270 LOCATE 1,6:IF C=1 THEN COLOR BR:PRINT"Û" ELSE COLOR PIN:PRINT"o"
|
||
280 LOCATE 2,5:IF C=2 THEN COLOR BR:PRINT"ÛÛ" ELSE IF C=0 THEN COLOR PIN:PRINT"oo" ELSE COLOR PIN:PRINT"o";:COLOR BR:PRINT"Û"
|
||
290 LOCATE 3,6:IF C=3 THEN COLOR BR:PRINT"Û" ELSE COLOR PIN:PRINT"o"
|
||
300 LOCATE 1,8:IF D=1 THEN COLOR BR:PRINT"Û" ELSE COLOR PIN:PRINT"o"
|
||
310 LOCATE 2,7:IF D=2 THEN COLOR BR:PRINT"ÛÛ" ELSE IF D=0 THEN COLOR PIN:PRINT"oo" ELSE COLOR PIN:PRINT"o";:COLOR BR:PRINT"Û"
|
||
320 LOCATE 3,8:IF D=3 THEN COLOR BR:PRINT"Û" ELSE COLOR PIN:PRINT"o"
|
||
330 LOCATE 1,10:IF E=1 THEN COLOR BR:PRINT"Û" ELSE COLOR PIN:PRINT"o"
|
||
340 LOCATE 2,9:IF E=2 THEN COLOR BR:PRINT"ÛÛ" ELSE IF E=0 THEN COLOR PIN:PRINT"oo" ELSE COLOR PIN:PRINT"o";:COLOR BR:PRINT"Û"
|
||
350 LOCATE 3,10:IF E=3 THEN COLOR BR:PRINT"Û" ELSE COLOR PIN:PRINT"o"
|
||
360 LOCATE 1,12:IF F=1 THEN COLOR BR:PRINT"Û" ELSE COLOR PIN:PRINT"o"
|
||
370 LOCATE 2,11:IF F=2 THEN COLOR BR:PRINT"ÛÛ" ELSE IF F=0 THEN COLOR PIN:PRINT"oo" ELSE COLOR PIN:PRINT"o";:COLOR BR:PRINT"Û"
|
||
380 LOCATE 3,12:IF F=3 THEN COLOR BR:PRINT"Û" ELSE COLOR PIN:PRINT"o"
|
||
390 LOCATE 1,14:IF G=1 THEN COLOR BR:PRINT"Û" ELSE COLOR PIN:PRINT"o"
|
||
400 LOCATE 2,13:IF G=2 THEN COLOR BR:PRINT"ÛÛ" ELSE IF G=0 THEN COLOR PIN:PRINT"oo" ELSE COLOR PIN:PRINT"o";:COLOR BR:PRINT"Û"
|
||
410 LOCATE 3,14:IF G=3 THEN COLOR BR:PRINT"Û" ELSE COLOR PIN:PRINT"o"
|
||
420 REM Untere Reihe
|
||
430 LOCATE 13,2:IF H=1 THEN COLOR BR:PRINT"Û" ELSE COLOR PIN:PRINT"o"
|
||
440 LOCATE 14,1:IF H=2 THEN COLOR BR:PRINT"ÛÛ" ELSE IF H=0 THEN COLOR PIN:PRINT"oo" ELSE COLOR PIN:PRINT"o";:COLOR BR:PRINT"Û"
|
||
450 LOCATE 15,2:IF H=3 THEN COLOR BR:PRINT"Û" ELSE COLOR PIN:PRINT"o"
|
||
460 LOCATE 13,4:IF I=1 THEN COLOR BR:PRINT"Û" ELSE COLOR PIN:PRINT"o"
|
||
470 LOCATE 14,3:IF I=2 THEN COLOR BR:PRINT"ÛÛ" ELSE IF I=0 THEN COLOR PIN:PRINT"oo" ELSE COLOR PIN:PRINT"o";:COLOR BR:PRINT"Û"
|
||
480 LOCATE 15,4:IF I=3 THEN COLOR BR:PRINT"Û" ELSE COLOR PIN:PRINT"o"
|
||
490 LOCATE 13,6:IF J=1 THEN COLOR BR:PRINT"Û" ELSE COLOR PIN:PRINT"o"
|
||
500 LOCATE 14,5:IF J=2 THEN COLOR BR:PRINT"ÛÛ" ELSE IF J=0 THEN COLOR PIN:PRINT"oo" ELSE COLOR PIN:PRINT"o";:COLOR BR:PRINT"Û"
|
||
510 LOCATE 15,6:IF J=3 THEN COLOR BR:PRINT"Û" ELSE COLOR PIN:PRINT"o"
|
||
520 LOCATE 13,8:IF K=1 THEN COLOR BR:PRINT"Û" ELSE COLOR PIN:PRINT"o"
|
||
530 LOCATE 14,7:IF K=2 THEN COLOR BR:PRINT"ÛÛ" ELSE IF K=0 THEN COLOR PIN:PRINT"oo" ELSE COLOR PIN:PRINT"o";:COLOR BR:PRINT"Û"
|
||
540 LOCATE 15,8:IF K=3 THEN COLOR BR:PRINT"Û" ELSE COLOR PIN:PRINT"o"
|
||
550 LOCATE 13,10:IF L=1 THEN COLOR BR:PRINT"Û" ELSE COLOR PIN:PRINT"o"
|
||
560 LOCATE 14,9:IF L=2 THEN COLOR BR:PRINT"ÛÛ" ELSE IF L=0 THEN COLOR PIN:PRINT"oo" ELSE COLOR PIN:PRINT"o";:COLOR BR:PRINT"Û"
|
||
570 LOCATE 15,10:IF L=3 THEN COLOR BR:PRINT"Û" ELSE COLOR PIN:PRINT"o"
|
||
580 LOCATE 13,12:IF M=1 THEN COLOR BR:PRINT"Û" ELSE COLOR PIN:PRINT"o"
|
||
590 LOCATE 14,11:IF M=2 THEN COLOR BR:PRINT"ÛÛ" ELSE IF M=0 THEN COLOR PIN:PRINT"oo" ELSE COLOR PIN:PRINT"o";:COLOR BR:PRINT"Û"
|
||
600 LOCATE 15,12:IF M=3 THEN COLOR BR:PRINT"Û" ELSE COLOR PIN:PRINT"o"
|
||
610 LOCATE 13,14:IF N=1 THEN COLOR BR:PRINT"Û" ELSE COLOR PIN:PRINT"o"
|
||
620 LOCATE 14,13:IF N=2 THEN COLOR BR:PRINT"ÛÛ" ELSE IF N=0 THEN COLOR PIN:PRINT"oo" ELSE COLOR PIN:PRINT"o";:COLOR BR:PRINT"Û"
|
||
630 LOCATE 15,14:IF N=3 THEN COLOR BR:PRINT"Û" ELSE COLOR PIN:PRINT"o"
|
||
640 LOCATE 1,40:IF TUR=0 THEN COLOR OF:PRINT"ÛÛÛ" ELSE COLOR 14:PRINT"ÛÛÛ"
|
||
650 COLOR 15:LOCATE 2,39:PRINT"TURBO"
|
||
660 IF A=1 AND TUR=0 OR A=3 AND TUR=1 THEN COLOR CO ELSE COLOR OF
|
||
670 IF A=2 THEN COLOR CO
|
||
680 LOCATE 6,2:PRINT"Û":LOCATE 7,2:PRINT"Û"
|
||
690 IF B=1 AND TUR=0 OR B=3 AND TUR=1 THEN COLOR CO ELSE COLOR OF
|
||
700 IF B=2 THEN COLOR CO
|
||
710 LOCATE 8,3:PRINT"ÛÛÛ"
|
||
720 IF C=1 AND TUR=0 OR C=3 AND TUR=1 THEN COLOR CO ELSE COLOR OF
|
||
730 IF C=2 THEN COLOR CO
|
||
740 LOCATE 5,3:PRINT"ÜÜÜ"
|
||
750 IF D=1 AND TUR=0 OR D=3 AND TUR=1 THEN COLOR CO ELSE COLOR OF
|
||
760 IF D=2 THEN COLOR CO
|
||
770 LOCATE 6,6:PRINT"Û":LOCATE 7,6:PRINT"Û"
|
||
780 IF E=1 AND TUR=0 OR E=3 AND TUR=1 THEN COLOR CO ELSE COLOR OF
|
||
790 IF E=2 THEN COLOR CO
|
||
800 LOCATE 6,9:PRINT"Û":LOCATE 7,9:PRINT"Û"
|
||
810 IF F=1 AND TUR=0 OR F=3 AND TUR=1 THEN COLOR CO ELSE COLOR OF
|
||
820 IF F=2 THEN COLOR CO
|
||
830 LOCATE 5,10:PRINT"ÜÜÜ"
|
||
840 IF G=1 AND TUR=0 OR G=3 AND TUR=1 THEN COLOR CO ELSE COLOR OF
|
||
850 IF G=2 THEN COLOR CO
|
||
860 LOCATE 6,13:PRINT"Û":LOCATE 7,13:PRINT"Û"
|
||
870 REM Untere Reihe
|
||
880 IF H=1 AND TUR=0 OR H=3 AND TUR=1 THEN COLOR CO ELSE COLOR OF
|
||
890 IF H=2 THEN COLOR CO
|
||
900 LOCATE 9,2:PRINT"Û":LOCATE 10,2:PRINT"Û"
|
||
910 IF I=1 AND TUR=0 OR I=3 AND TUR=1 THEN COLOR CO ELSE COLOR OF
|
||
920 IF I=2 THEN COLOR CO
|
||
930 LOCATE 11,3:PRINT"ßßß"
|
||
940 IF J=1 AND TUR=0 OR J=3 AND TUR=1 THEN COLOR CO ELSE COLOR OF
|
||
950 IF J=2 THEN COLOR CO
|
||
960 LOCATE 9,6:PRINT"Û":LOCATE 10,6:PRINT"Û"
|
||
970 IF K=1 AND TUR=0 OR K=3 AND TUR=1 THEN COLOR CO ELSE COLOR OF
|
||
980 IF K=2 THEN COLOR CO
|
||
990 LOCATE 9,9:PRINT"Û":LOCATE 10,9:PRINT"Û"
|
||
1000 IF L=1 AND TUR=0 OR L=3 AND TUR=1 THEN COLOR CO ELSE COLOR OF
|
||
1010 IF L=2 THEN COLOR CO
|
||
1020 LOCATE 11,10:PRINT"ßßß"
|
||
1030 IF M=1 AND TUR=0 OR M=3 AND TUR=1 THEN COLOR CO ELSE COLOR OF
|
||
1040 IF M=2 THEN COLOR CO
|
||
1050 LOCATE 8,10:PRINT"ÛÛÛ"
|
||
1060 IF N=1 AND TUR=0 OR N=3 AND TUR=1 THEN COLOR CO ELSE COLOR OF
|
||
1070 IF N=2 THEN COLOR CO
|
||
1080 LOCATE 9,13:PRINT"Û":LOCATE 10,13:PRINT"Û"
|
||
1090 COLOR OF:LOCATE 11,7:PRINT"Ü":LOCATE 11,14:PRINT"Ü"
|
||
1100 LOCATE 16,30:COLOR 15:PRINT" A B C D E F G H I J K L M N"
|
||
1110 LOCATE 17,30
|
||
1120 X=A:GOSUB 1150:X=B:GOSUB 1150:X=C:GOSUB 1150:X=D:GOSUB 1150:X=E:GOSUB 1150:X=F:GOSUB 1150:X=G:GOSUB 1150
|
||
1130 X=H:GOSUB 1150:X=I:GOSUB 1150:X=J:GOSUB 1150:X=K:GOSUB 1150:X=L:GOSUB 1150:X=M:GOSUB 1150:X=N:GOSUB 1150
|
||
1140 GOTO 1200
|
||
1150 IF X=0 THEN COLOR 15
|
||
1160 IF X=1 THEN COLOR 8
|
||
1170 IF X=2 THEN COLOR 10
|
||
1180 IF X=3 THEN COLOR 14
|
||
1190 PRINT X;:RETURN
|
||
1200 REM Eingaberoutine
|
||
1210 A$=INKEY$:IF A$="" THEN 1210
|
||
1220 IF A$="T" OR A$="t" THEN IF TUR=0 THEN TUR=1:GOTO 640 ELSE TUR=0:GOTO 640
|
||
1230 IF A$=" " THEN 1890
|
||
1240 IF A$="w" OR A$="W" THEN 2120
|
||
1250 IF A$="q" OR A$="Q" THEN 2310
|
||
1260 IF A$="r" OR A$="R" THEN 2190
|
||
1270 IF A$="s" OR A$="S" THEN 2260
|
||
1280 IF A$="u" OR A$="U" THEN 2490
|
||
1290 IF A$="z" OR A$="Z" THEN 2330
|
||
1300 IF A$="a" OR A$="A" THEN 1470
|
||
1310 IF A$="b" OR A$="B" THEN 1500
|
||
1320 IF A$="c" OR A$="C" THEN 1530
|
||
1330 IF A$="d" OR A$="D" THEN 1560
|
||
1340 IF A$="e" OR A$="E" THEN 1590
|
||
1350 IF A$="f" OR A$="F" THEN 1620
|
||
1360 IF A$="g" OR A$="G" THEN 1650
|
||
1370 IF A$="h" OR A$="H" THEN 1680
|
||
1380 IF A$="i" OR A$="I" THEN 1710
|
||
1390 IF A$="j" OR A$="J" THEN 1740
|
||
1400 IF A$="k" OR A$="K" THEN 1770
|
||
1410 IF A$="l" OR A$="L" THEN 1800
|
||
1420 IF A$="m" OR A$="M" THEN 1830
|
||
1430 IF A$="n" OR A$="N" THEN 1860
|
||
1440 IF A$="^" OR A$="ø" THEN CLS:COLOR 15:END
|
||
1450 GOTO 1210
|
||
1460 REM INPUT
|
||
1470 LOCATE 17,1:INPUT "Neuer Wert f<>r A: ",A
|
||
1480 IF A<0 OR A>3 THEN 1470
|
||
1490 LOCATE 17,1:PRINT SPACE$(25):GOTO 100
|
||
1500 LOCATE 17,1:INPUT "Neuer Wert f<>r B: ",B
|
||
1510 IF B<0 OR B>3 THEN 1500
|
||
1520 LOCATE 17,1:PRINT SPACE$(25):GOTO 100
|
||
1530 LOCATE 17,1:INPUT "Neuer Wert f<>r C: ",C
|
||
1540 IF C<0 OR C>3 THEN 1530
|
||
1550 LOCATE 17,1:PRINT SPACE$(25):GOTO 100
|
||
1560 LOCATE 17,1:INPUT "Neuer Wert f<>r D: ",D
|
||
1570 IF D<0 OR D>3 THEN 1560
|
||
1580 LOCATE 17,1:PRINT SPACE$(25):GOTO 100
|
||
1590 LOCATE 17,1:INPUT "Neuer Wert f<>r E: ",E
|
||
1600 IF E<0 OR E>3 THEN 1590
|
||
1610 LOCATE 17,1:PRINT SPACE$(25):GOTO 100
|
||
1620 LOCATE 17,1:INPUT "Neuer Wert f<>r F: ",F
|
||
1630 IF F<0 OR F>3 THEN 1620
|
||
1640 LOCATE 17,1:PRINT SPACE$(25):GOTO 100
|
||
1650 LOCATE 17,1:INPUT "Neuer Wert f<>r G: ",G
|
||
1660 IF G<0 OR G>3 THEN 1650
|
||
1670 LOCATE 17,1:PRINT SPACE$(25):GOTO 100
|
||
1680 LOCATE 17,1:INPUT "Neuer Wert f<>r H: ",H
|
||
1690 IF H<0 OR H>3 THEN 1680
|
||
1700 LOCATE 17,1:PRINT SPACE$(25):GOTO 100
|
||
1710 LOCATE 17,1:INPUT "Neuer Wert f<>r I: ",I
|
||
1720 IF I<0 OR I>3 THEN 1710
|
||
1730 LOCATE 17,1:PRINT SPACE$(25):GOTO 100
|
||
1740 LOCATE 17,1:INPUT "Neuer Wert f<>r J: ",J
|
||
1750 IF J<0 OR J>3 THEN 1740
|
||
1760 LOCATE 17,1:PRINT SPACE$(25):GOTO 100
|
||
1770 LOCATE 17,1:INPUT "Neuer Wert f<>r K: ",K
|
||
1780 IF K<0 OR K>3 THEN 1770
|
||
1790 LOCATE 17,1:PRINT SPACE$(25):GOTO 100
|
||
1800 LOCATE 17,1:INPUT "Neuer Wert f<>r L: ",L
|
||
1810 IF L<0 OR L>3 THEN 1800
|
||
1820 LOCATE 17,1:PRINT SPACE$(25):GOTO 100
|
||
1830 LOCATE 17,1:INPUT "Neuer Wert f<>r M: ",M
|
||
1840 IF M<0 OR M>3 THEN 1830
|
||
1850 LOCATE 17,1:PRINT SPACE$(25):GOTO 100
|
||
1860 LOCATE 17,1:INPUT "Neuer Wert f<>r N: ",N
|
||
1870 IF N<0 OR N>3 THEN 1860
|
||
1880 LOCATE 17,1:PRINT SPACE$(25):GOTO 100
|
||
1890 REM Gesamteingabe
|
||
1900 COLOR 15
|
||
1910 LOCATE 17,1:INPUT"A=",A:IF A<0 OR A>3 THEN 1910
|
||
1920 INPUT"B=",B:IF B<0 OR B>3 THEN LOCATE 18,1:GOTO 1920
|
||
1930 INPUT"C=",C:IF C<0 OR C>3 THEN LOCATE 19,1:GOTO 1930
|
||
1940 INPUT"D=",D:IF D<0 OR D>3 THEN LOCATE 20,1:GOTO 1940
|
||
1950 INPUT"E=",E:IF E<0 OR E>3 THEN LOCATE 21,1:GOTO 1950
|
||
1960 INPUT"F=",F:IF E<0 OR E>3 THEN LOCATE 22,1:GOTO 1960
|
||
1970 INPUT"G=",G:IF G<0 OR G>3 THEN LOCATE 23,1:GOTO 1970
|
||
1980 LOCATE 17,5:INPUT"H=",H:IF H<0 OR H>3 THEN 1980
|
||
1990 LOCATE 18,5:INPUT"I=",I:IF I<0 OR I>3 THEN 1990
|
||
2000 LOCATE 19,5:INPUT"J=",J:IF J<0 OR J>3 THEN 2000
|
||
2010 LOCATE 20,5:INPUT"K=",K:IF K<0 OR K>3 THEN 2010
|
||
2020 LOCATE 21,5:INPUT"L=",L:IF L<0 OR L>3 THEN 2020
|
||
2030 LOCATE 22,5:INPUT"M=",M:IF M<0 OR M>3 THEN 2030
|
||
2040 LOCATE 23,5:INPUT"N=",N:IF N<0 OR N>3 THEN 2040
|
||
2050 LOCATE 17,1:PRINT SPACE$(70)
|
||
2060 PRINT SPACE$(70)
|
||
2070 PRINT SPACE$(70)
|
||
2080 PRINT SPACE$(70)
|
||
2090 PRINT SPACE$(70)
|
||
2100 PRINT SPACE$(70)
|
||
2110 PRINT SPACE$(70):GOTO 100
|
||
2120 REM Werte speichern
|
||
2130 OPEN "O",#1,FLE$
|
||
2140 LOCATE 17,1:COLOR 15:PRINT"Werte gesichert!"
|
||
2150 WRITE#1,A,B,C,D,E,F,G,H,I,J,K,L,M,N
|
||
2160 WRITE#1,TUR
|
||
2170 CLOSE #1
|
||
2180 GOTO 1200
|
||
2190 REM Werte laden
|
||
2200 OPEN "I",#1,FLE$
|
||
2210 LOCATE 17,1:COLOR 15:PRINT"Werte geladen! "
|
||
2220 INPUT#1,A,B,C,D,E,F,G,H,I,J,K,L,M,N
|
||
2230 INPUT#1,TUR
|
||
2240 CLOSE #1
|
||
2250 GOTO 100
|
||
2260 REM Datei „ndern
|
||
2270 LOCATE 17,1:COLOR 15:INPUT"Neuer Dateiname: ",NFLE$
|
||
2280 IF NFLE$="" THEN CLS:GOTO 100
|
||
2290 FLE$=NFLE$
|
||
2300 CLS:GOTO 100
|
||
2310 REM RESET
|
||
2320 GOTO 70
|
||
2330 REM Zufall
|
||
2340 A=INT(RND(1)*4)
|
||
2350 B=INT(RND(1)*4)
|
||
2360 C=INT(RND(1)*4)
|
||
2370 D=INT(RND(1)*4)
|
||
2380 E=INT(RND(1)*4)
|
||
2390 F=INT(RND(1)*4)
|
||
2400 G=INT(RND(1)*4)
|
||
2410 H=INT(RND(1)*4)
|
||
2420 I=INT(RND(1)*4)
|
||
2430 J=INT(RND(1)*4)
|
||
2440 K=INT(RND(1)*4)
|
||
2450 L=INT(RND(1)*4)
|
||
2460 M=INT(RND(1)*4)
|
||
2470 N=INT(RND(1)*4)
|
||
2480 GOTO 100
|
||
2490 REM Directory
|
||
2500 LOCATE 17,1:COLOR 15
|
||
2510 FILES "*.CFG"
|
||
2520 PRINT"Bitte Taste dr<64>cken!"
|
||
2530 A$=INKEY$:IF A$="" THEN 2530
|
||
2540 LOCATE 17,1:FOR Z=1 TO 7:PRINT SPACE$(79):NEXT Z
|
||
2550 GOTO 1200
|
||
|