Add Caesar cipher project with Doxygen docs

This commit is contained in:
2026-10-04 13:11:15 +08:00
parent 99cccdf3da
commit 0957bff43a
12 changed files with 248 additions and 1 deletions
+20
View File
@@ -0,0 +1,20 @@
## @file main.py
# @brief Interactive command line interface.
from caesar_cipher import constants as c
from caesar_cipher.cipher import encrypt
def main() -> None:
## @brief Ask for a message and a shift, then print the encrypted text.
text = input(c.PROMPT_TEXT)
try:
shift = int(input(c.PROMPT_SHIFT))
except ValueError:
print("The shift must be a whole number.")
return
print(f"Here's the encoded result: {encrypt(text, shift)}")
if __name__ == "__main__":
main()