DEV Community

snipforge
snipforge

Posted on

Enigma Breaker - A Cipher Decoding Game Built as an Ode to Alan Turing published

June Solstice Game Jam Submission

This is a submission for the June Solstice Game Jam

@ben @jess

What I Built:
Enigma Breaker is a cipher decoding puzzle game set at Bletchley Park in 1942. Enemy messages have been intercepted and encrypted with a substitution cipher. Your job is to figure out the letter substitutions and decode the full message before the timer runs out.
The game has 5 levels of increasing difficulty, a story card system that walks through Alan Turing's real biography between each level, a trivia quiz after each story card, and a final 5-question debrief at the end. Three difficulty modes, star ratings per level, hint system and high score tracking with localStorage.

Play it here:

Code:
The full game is in a single HTML file with no external dependencies. Built entirely with vanilla HTML, CSS and JavaScript.

How I Built It Cipher system:
Each level generates a fresh random substitution cipher by shuffling the alphabet and ensuring no letter maps to itself. The player builds up a mapping between cipher letters and plain letters. The game checks for a complete correct solution after every input.

How decoding works:
The intercepted message appears in yellow at the top. The player clicks a cipher letter to select it, then clicks a letter in the alphabet row below or presses a keyboard key to map it. Correct mappings turn green. Wrong mappings flash red for 400ms and clear automatically so they do not clutter the decode panel. A progress bar fills as more letters are correctly mapped.

Frequency hints:
The five most common cipher letters in the message are shown as hints. Since E, T, A, O, I and N are the most frequent letters in English, the most common cipher letters likely map to one of those. This is the same frequency analysis technique used in real cryptanalysis.

Audio:
All sounds are synthesized with the Web Audio API. No audio files are loaded. There are distinct sounds for correct mappings, wrong guesses, the ticking clock, an alarm at 5 seconds remaining, level completion and the final win fanfare. The clock tick frequency increases as time gets lower.
Story and quiz system
After each level a story card appears covering a chapter of Turing's real biography. After reading it the player answers one multiple choice question for 10 bonus points. The game shows the correct answer and an explanation regardless of whether the player got it right. After all five levels there is a final quiz with five harder questions about his legacy.

Message pool:
There are 10 possible intercepted messages. Five are picked randomly each game so repeat playthroughs feel different.

Prize Category:
Best Ode to Alan Turing
This game connects to the Alan Turing prize category in three ways.
First, the mechanic. Substitution cipher decoding is a simplified version of the cryptanalysis work done at Bletchley Park. The frequency analysis hints mirror the actual technique used to crack substitution ciphers before automated machines took over.
Second, the story system. The five story cards cover Turing's real biography in order, from his birth in June 1912 through the publication of the Turing Machine paper, his work breaking Enigma during World War II, the Imitation Game paper that launched the field of AI, and finally his prosecution and death in 1954. Each card is followed by a trivia question so the history is reinforced through interaction rather than passive reading.
Third, the June connection. The final quiz question asks which modern celebration shares Turing's birth month. The answer is Pride Month. Turing was born in June 1912 and was a gay man who was prosecuted by his own government. That connection between his birth month and Pride Month is why this game exists and why it fits the June Solstice theme.

Built with HTML5 and Web Audio API. No libraries or frameworks.
June 2026

Top comments (0)