Data update
This commit is contained in:
parent
61b93a2cd1
commit
5af6d93694
858 changed files with 20572 additions and 2082 deletions
16
Task/Caesar-cipher/GW-BASIC/caesar-cipher.basic
Normal file
16
Task/Caesar-cipher/GW-BASIC/caesar-cipher.basic
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
10 REM Caesar cipher
|
||||
20 CLS
|
||||
30 DEC$ = ""
|
||||
40 TYPE$ = "cleartext "
|
||||
50 PRINT "If decrypting enter "+"<d> "+" -- else press enter "; : INPUT DEC$
|
||||
60 INPUT "Enter offset > "; IOFFSET
|
||||
70 IF DEC$ = "d" THEN IOFFSET = 26-IOFFSET: TYPE$ = "ciphertext "
|
||||
110 PRINT "Enter "+TYPE$+"> ";
|
||||
120 INPUT CAD$
|
||||
140 LONGITUD = LEN(CAD$)
|
||||
150 FOR I = 1 TO LONGITUD
|
||||
160 ITEMP = ASC(MID$(CAD$,I,1))
|
||||
170 IF ITEMP > 64 AND ITEMP < 91 THEN ITEMP = ((ITEMP-65)+IOFFSET) MOD 26 : PRINT CHR$(ITEMP+65); : ELSE PRINT CHR$(ITEMP);
|
||||
230 NEXT I
|
||||
240 PRINT
|
||||
250 END
|
||||
Loading…
Add table
Add a link
Reference in a new issue