Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,22 @@
plaintext$ = "Pack my box with five dozen liquor jugs"
PRINT plaintext$
key% = RND(25)
cyphertext$ = FNcaesar(plaintext$, key%)
PRINT cyphertext$
decyphered$ = FNcaesar(cyphertext$, 26-key%)
PRINT decyphered$
END
DEF FNcaesar(text$, key%)
LOCAL I%, C%
FOR I% = 1 TO LEN(text$)
C% = ASC(MID$(text$,I%))
IF (C% AND &1F) >= 1 AND (C% AND &1F) <= 26 THEN
C% = (C% AND &E0) OR (((C% AND &1F) + key% - 1) MOD 26 + 1)
MID$(text$, I%, 1) = CHR$(C%)
ENDIF
NEXT
= text$