From 23920886f508292cd5abe6baa8622486fd0dd4a4 Mon Sep 17 00:00:00 2001 From: Arun35 Date: Sun, 24 May 2026 01:47:16 +0530 Subject: [PATCH 1/4] Add files via upload --- utilities/Caesar-cipher/caesar_ciphar.py | 63 ++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 utilities/Caesar-cipher/caesar_ciphar.py diff --git a/utilities/Caesar-cipher/caesar_ciphar.py b/utilities/Caesar-cipher/caesar_ciphar.py new file mode 100644 index 0000000..d09ab6c --- /dev/null +++ b/utilities/Caesar-cipher/caesar_ciphar.py @@ -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") \ No newline at end of file From acbeb57330fc907365b4cabe41b302a0526ccd10 Mon Sep 17 00:00:00 2001 From: Arun35 Date: Sun, 24 May 2026 01:48:21 +0530 Subject: [PATCH 2/4] Add files via upload --- web-app/js/projects/ceasar-ciphar.js | 412 +++++++++++++++++++++++++++ 1 file changed, 412 insertions(+) create mode 100644 web-app/js/projects/ceasar-ciphar.js diff --git a/web-app/js/projects/ceasar-ciphar.js b/web-app/js/projects/ceasar-ciphar.js new file mode 100644 index 0000000..21e449a --- /dev/null +++ b/web-app/js/projects/ceasar-ciphar.js @@ -0,0 +1,412 @@ +function getCaesarCipherHTML() { + return ` +
+

šŸ” Caesar Cipher Encoder & Decoder

+

Encrypt and decrypt messages using Caesar Cipher

+ +
+
+ + + + +
+ +
+ + +
+ +
+ +
+ + +
+
+ +
+ + +
+ +
+

Output:

+
+

Your result will appear here...

+
+ +
+ +
+

šŸ”” How the shift works:

+
+
+
+
+ + + `; +} + + +function initCaesarCipher() { + const textBox = document.getElementById('cipherInput'); + const goBtn = document.getElementById('cipherBtn'); + const clearBtn = document.getElementById('clearBtn'); + const copyBtn = document.getElementById('copyBtn'); + const outputBox = document.getElementById('cipherOutput'); + const shiftNumber = document.getElementById('shiftInput'); + const shiftSlide = document.getElementById('shiftSlider'); + const encryptRadio = document.getElementById('modeEncrypt'); + const decryptRadio = document.getElementById('modeDecrypt'); + const theLabel = document.getElementById('inputLabel'); + const previewDiv = document.getElementById('shiftPreview'); + + const ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; + + function encryptText(text, shift) { + let result = ''; + + for (const ch of text) { + if (ch >= 'A' && ch <= 'Z') { + result += String.fromCharCode(((ch.charCodeAt(0) - 65 + shift) % 26 + 26) % 26 + 65); + } else if (ch >= 'a' && ch <= 'z') { + result += String.fromCharCode(((ch.charCodeAt(0) - 97 + shift) % 26 + 26) % 26 + 97); + } else { + result += ch; + } + } + + return result; + } + + function decryptText(text, shift) { + return encryptText(text, -shift); + } + + function buildAlphabetRow(label, getChar, className) { + const row = document.createElement('div'); + row.className = 'alphabet-row'; + + const labelEl = document.createElement('span'); + labelEl.className = 'row-label'; + labelEl.textContent = label; + row.appendChild(labelEl); + + for (let i = 0; i < 26; i++) { + const box = document.createElement('span'); + box.className = `letter-box ${className}`; + box.textContent = getChar(i); + row.appendChild(box); + } + + return row; + } + + function showPreview(shift) { + previewDiv.innerHTML = ''; + previewDiv.appendChild(buildAlphabetRow('Original:', i => ALPHABET[i], 'plain')); + previewDiv.appendChild(buildAlphabetRow(`Shift +${shift}:`, i => ALPHABET[(i + shift) % 26], 'cipher')); + } + + function setMode(isEncrypt) { + theLabel.textContent = isEncrypt ? 'šŸ“ Enter Text to Encrypt:' : 'šŸ“Ø Enter Text to Decrypt:'; + textBox.placeholder = isEncrypt ? 'Type your message here...' : 'Paste the encrypted text here...'; + textBox.value = ''; + outputBox.innerHTML = '

Your result will appear here...

'; + copyBtn.style.display = 'none'; + goBtn.textContent = isEncrypt ? 'šŸ” Encrypt Message' : 'šŸ“ Decrypt Message'; + } + + function syncSlider(val) { + const clamped = Math.min(25, Math.max(1, val)); + shiftNumber.value = clamped; + shiftSlide.value = clamped; + showPreview(clamped); + } + + function showError(msg) { + outputBox.innerHTML = `

āŒ ${msg}

`; + copyBtn.style.display = 'none'; + } + + function showResult(text) { + outputBox.innerHTML = ''; + const p = document.createElement('p'); + p.className = 'result-text'; + p.textContent = text; + outputBox.appendChild(p); + copyBtn.style.display = 'inline-block'; + copyBtn.dataset.result = text; + } + + encryptRadio.addEventListener('change', () => setMode(true)); + decryptRadio.addEventListener('change', () => setMode(false)); + + shiftSlide.addEventListener('input', () => syncSlider(parseInt(shiftSlide.value))); + shiftNumber.addEventListener('input', () => syncSlider(parseInt(shiftNumber.value))); + + goBtn.addEventListener('click', () => { + const text = textBox.value; + const shift = parseInt(shiftNumber.value); + + if (!text.trim()) return showError('Please enter some text first!'); + if (isNaN(shift) || shift < 1 || shift > 25) return showError('Please enter a shift value between 1 and 25!'); + + const result = encryptRadio.checked ? encryptText(text, shift) : decryptText(text, shift); + showResult(result); + }); + + clearBtn.addEventListener('click', () => { + textBox.value = ''; + outputBox.innerHTML = '

Your result will appear here...

'; + copyBtn.style.display = 'none'; + }); + + copyBtn.addEventListener('click', () => { + navigator.clipboard.writeText(copyBtn.dataset.result).then(() => { + const original = copyBtn.textContent; + copyBtn.textContent = 'āœ… Copied!'; + setTimeout(() => copyBtn.textContent = original, 1500); + }); + }); + + showPreview(3); +} \ No newline at end of file From 4b579033a44708c21001abef135af1e7d8554741 Mon Sep 17 00:00:00 2001 From: Arun35 Date: Sun, 24 May 2026 01:57:52 +0530 Subject: [PATCH 3/4] Add caesar-cipher to project functions and initializers --- web-app/js/projects.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web-app/js/projects.js b/web-app/js/projects.js index 04ba8fd..6150066 100644 --- a/web-app/js/projects.js +++ b/web-app/js/projects.js @@ -39,6 +39,7 @@ function getProjectHTML(projectName) { '2048-game': () => get2048GameHTML(), 'productive-pet': () => getProductivePetHTML(), 'color-palette': () => getColorPaletteHTML(), + 'caesar-cipher': () => getCaesarCipherHTML(), }; try { @@ -3276,7 +3277,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]; From 52a6aa24562184d4898b31d702ae793073771536 Mon Sep 17 00:00:00 2001 From: Arun35 Date: Sun, 24 May 2026 02:55:51 +0530 Subject: [PATCH 4/4] Add Vercel entrypoint configuration --- pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 14190d8..8cc4c25 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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"