Skip to content

feat(alien_translator): add static and randomized cipher modes - #98

Merged
Yugo206 merged 1 commit into
Yugo206:mainfrom
andrianbalanesq:fix/alien-translator-cipher-modes
Jul 5, 2026
Merged

feat(alien_translator): add static and randomized cipher modes#98
Yugo206 merged 1 commit into
Yugo206:mainfrom
andrianbalanesq:fix/alien-translator-cipher-modes

Conversation

@andrianbalanesq

Copy link
Copy Markdown
Contributor

Summary

Adds two cipher modes to the Alien Translator game so the user can pick between them at runtime.

  • static — builds a deterministic letter-to-letter substitution cipher once per session. Every input letter maps to the same alien letter each time, so translations are consistent within a run (and can be reversed). Includes a decode toggle that uses the session's reverse mapping to translate ciphered text back to English.
  • randomized — replaces every alphabet character with a random letter (the original behavior), preserving case and non-letter characters so the output keeps the shape of the input.

The mode is picked at startup; quit, q, and exit work at every prompt.

Closes #90

Closes Yugo206#90

Adds two cipher modes to the Alien Translator game:

- static: builds a deterministic letter-to-letter substitution cipher
  once per session; each input letter maps to the same alien letter
  every time, so repeated translations are consistent within the run.
  Includes a 'decode' toggle that translates ciphered text back to
  English using the same session mapping.
- randomized: replaces every alphabet character with a random letter,
  preserving the original word shape (case and non-letter characters).

The user is prompted to pick a mode at the start of the game; quit
shortcuts are honored at every prompt.

@Yugo206 Yugo206 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update!

I really like this version. Adding both the static and randomized modes gives the user more choice, and the decode mode is a nice addition. The code is clean and easy to follow.

Thanks for taking the feedback into account. Everything looks good to me!

@Yugo206
Yugo206 merged commit 50e5bd0 into Yugo206:main Jul 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Alien Translator: add static and randomized cipher modes

4 participants