mirror of
https://github.com/mbirth/gwbasic.git
synced 2024-11-09 23:06:45 +00:00
68 lines
2.0 KiB
QBasic
68 lines
2.0 KiB
QBasic
5 CODE=0
|
||
10 CLS
|
||
20 COLOR 12
|
||
30 LOCATE 1,27:PRINT"*** CODIERUNGs-Programm ***"
|
||
40 COLOR 10
|
||
50 LOCATE 2,26:PRINT"Geschrieben in GW-Basic v3.23"
|
||
60 LOCATE 3,27:PRINT"von Markus ";CHR$(34);"RoboCop";CHR$(34);" Birth"
|
||
70 COLOR 15
|
||
80 PRINT:PRINT:PRINT
|
||
90 PRINT"Geben Sie die Umwandlungsart ein:"
|
||
100 PRINT
|
||
110 COLOR 14
|
||
120 PRINT" CODE - Text Codieren"
|
||
130 PRINT"DECODE - Text DeCodieren"
|
||
140 LOCATE 24,76:PRINT CODE;
|
||
150 LOCATE 7,1:INPUT"Geben Sie die Umwandlungsart ein: ",WAND$
|
||
160 WAND=0
|
||
170 IF WAND$="CODE" OR WAND$="code" THEN WAND=1
|
||
180 IF WAND$="DECODE" OR WAND$="decode" THEN WAND=2
|
||
190 IF WAND=0 THEN GOTO 140
|
||
200 CLS:COLOR 15
|
||
210 IF WAND=1 THEN X$="Text" ELSE X$="Code"
|
||
220 PRINT"Geben Sie den zu šbersetzenden ";X$;" ein!"
|
||
230 COLOR 14:PRINT"Aktueller Modus: ";
|
||
240 IF WAND=1 THEN COLOR 12:PRINT"TEXT --> CODE"
|
||
250 IF WAND=2 THEN COLOR 12:PRINT"CODE --> TEXT"
|
||
260 COLOR 14:PRINT"CODEWEITE: ";:COLOR 12:PRINT CODE
|
||
270 COLOR 15
|
||
280 PRINT "LoAd - gespeicherten ";X$;" aus OUTPUT.TXT laden"
|
||
290 INPUT">",TEXT$
|
||
300 IF TEXT$="LoAd" THEN GOSUB 600
|
||
310 LOCATE 5,2:PRINT TEXT$
|
||
320 L=LEN(TEXT$)
|
||
330 DIM ER$(L+1)
|
||
340 FOR Z=1 TO L
|
||
350 CHAR$=MID$(TEXT$,Z,1)
|
||
360 IF WAND=1 THEN ER$(Z)=CHR$(ASC(CHAR$)+CODE+Z)
|
||
370 IF WAND=2 THEN ER$(Z)=CHR$(ASC(CHAR$)-CODE-Z)
|
||
380 LOCATE 15,Z:PRINT ER$(Z)
|
||
390 FOR W=0 TO 1500:NEXT
|
||
400 NEXT Z
|
||
410 FOR Z=1 TO L
|
||
420 ERG$=ERG$+ER$(Z)
|
||
430 NEXT Z
|
||
440 LOCATE 14,1:COLOR 15
|
||
450 PRINT"Der šbersetzte ";X$;" lautet:"
|
||
460 REM PRINT ERG$
|
||
470 COLOR 12:LOCATE 22,1:PRINT"[S] šbersetzten ";X$;" in Datei OUTPUT.TXT speichern"
|
||
480 LOCATE 24,29:COLOR 10:PRINT"Bitte Taste dr<64>cken...";
|
||
490 A$=INKEY$:IF A$="" THEN 490
|
||
500 IF A$="s" OR A$="S" THEN GOSUB 540
|
||
510 CLS:PRINT"Fertig!!!":COLOR 15
|
||
520 PRINT
|
||
530 END
|
||
540 REM SAVE-Routine
|
||
550 OPEN "O",#1,"OUTPUT.TXT"
|
||
560 WRITE#1,CODE
|
||
570 WRITE#1,ERG$
|
||
580 CLOSE #1
|
||
590 RETURN
|
||
600 REM LOAD-Routine
|
||
610 OPEN "I",#1,"OUTPUT.TXT"
|
||
620 INPUT#1,CODE
|
||
630 LOCATE 3,17:COLOR 12:PRINT CODE:COLOR 15
|
||
640 INPUT#1,TEXT$
|
||
650 CLOSE #1
|
||
660 RETURN
|
||
|