Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,28 @@
decl string mode
while (not (or (= mode "encode") (= mode "decode")))
out "encode/decode: " console
set mode (lower (in string console))
end while
decl string message
out "message: " console
set message (upper (in string console))
decl int key
out "key: " console
set key (in int console)
if (or (> key 26) (< key 0))
out endl "invalid key" endl console
stop
end if
if (= mode "decode")
set key (int (- 26 key))
end if
for (decl int i) (< i (size message)) (inc i)
if (and (> (ord message<i>) 64) (< (ord message<i>) 91))
out (chr (int (+ (mod (int (+ (- (ord message<i>) 65) key)) 26) 65))) console
end if
end for
out endl console