Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ requires-python = ">=3.10"

[tool.unittest]
# No special configuration needed, unittest is standard library
[tool.vercel]
entrypoint = "math.Happy-Number.Happy-Number:app"
63 changes: 63 additions & 0 deletions utilities/Caesar-cipher/caesar_ciphar.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
print("🔐 Caesar Cipher Encoder & Decoder 🔐")
print("Encrypt and decrypt messages using Caesar Cipher\n")


def encrypt(text, shift):

result = ""

for char in text:

if char.isupper():
result += chr((ord(char) - 65 + shift) % 26 + 65)

elif char.islower():
result += chr((ord(char) - 97 + shift) % 26 + 97)

else:
result += char

return result


def decrypt(text, shift):

return encrypt(text, -shift)


while True:

print("=" * 50)
print("🎯 Choose an option:")
print("1️⃣ Encrypt Text")
print("2️⃣ Decrypt Text")
print("3️⃣ Exit")
print("=" * 50)

choice = input("\n➡️ Enter your choice (1-3): ")

if choice == '1':

text = input("\n📝 Enter text to encrypt: ")
shift = int(input("🔑 Enter shift value: "))

encrypted = encrypt(text, shift)

print(f"\n🔐 Encrypted Text: {encrypted}\n")

elif choice == '2':

text = input("\n📨 Enter text to decrypt: ")
shift = int(input("🔑 Enter shift value: "))

decrypted = decrypt(text, shift)

print(f"\n📝 Decrypted Text: {decrypted}\n")

elif choice == '3':

print("\n👋 Thanks for using Caesar Cipher! Goodbye!\n")
break

else:
print("\n❌ Invalid choice! Please select 1-3.\n")
Binary file added web-app/assets/banners/caesar-cipher.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
492 changes: 215 additions & 277 deletions web-app/index.html

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion web-app/js/projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ function getProjectHTML(projectName) {
'2048-game': () => get2048GameHTML(),
'productive-pet': () => getProductivePetHTML(),
'color-palette': () => getColorPaletteHTML(),
'caesar-cipher': () => getCaesarCipherHTML(),
};

try {
Expand Down Expand Up @@ -3630,7 +3631,8 @@ function initializeProject(projectName) {
'simon-says': 'initSimonSays',
'2048-game': 'init2048Game',
'color-palette': 'initColorPalette',
'math-quiz': 'initMathQuiz'
'math-quiz': 'initMathQuiz',
'caesar-cipher': 'initCaesarCipher'
};

const initializerName = initializers[projectName];
Expand Down
Loading
Loading