Skip to main content
100%

Caesars Cipher (ROT13) - FCC Challenge

✓ Published0🌍 Public
Aadammarcwilliams
Last edited Aug 4, 2016
Created on Aug 4, 2016

This example demonstrates the ROT13 Caesar cipher, a letter-substitution cipher that shifts each alphabetic character by 13 positions. It shows the transformation of an encoded input string into its decoded plaintext output. The JavaScript function `rot13` processes the string by splitting it into an array, applying the cipher logic via `Array.map`, and rejoining the characters. The cipher uses `charCodeAt` and `String.fromCharCode` to handle character codes, preserving non-alphabetic characters while shifting letters in the ranges A–M and N–Z. The visible test case decodes "V PENPXRQ GUR PBQR" to reveal the original message.

AI-generated description

Similar vizzes