A silly caesar cipher thing

This commit is contained in:
Dan Buch 2021-07-07 10:00:55 -04:00
parent 59b9b57974
commit 159b0ae613
Signed by: meatballhat
GPG Key ID: 9685130D8B763EA7

24
local/bin/caesar Executable file
View File

@ -0,0 +1,24 @@
#!/usr/bin/env python
from __future__ import print_function
import sys
def main(sysargs=sys.argv[:]):
d = {}
for c in (65, 97):
for i in range(26):
d[chr(i+c)] = chr((i+13) % 26 + c)
print(
"".join([
d.get(c, c) for c in " ".join(sysargs[1:])
]),
end=""
)
return 0
if __name__ == "__main__":
sys.exit(main())