CodeBreaker
Mastermind in the browser, rewritten in TypeScript from a Python terminal game, with four difficulty levels and two-player pass-and-play.
Play
Play CodeBreaker in a new tab (full screen, or if the game below doesn't load)
About this project
CodeBreaker is Mastermind: crack a secret four-color code in six guesses, using the feedback pegs after each guess. Play against the computer, or in two-player mode, where one player sets the code and the other cracks it.
v1 was a terminal game I wrote by hand in Python. See the v1.0 tag for that version.
v2, the one above, is a rewrite in TypeScript for the browser, built with Vite, tested with Vitest, and deployed to GitHub Pages by GitHub Actions.
Four difficulty levels
| Level | Blank slots | Repeated colors | Feedback pegs |
|---|---|---|---|
| Easy | No | No | Under the slot they describe |
| Medium | Yes | No | Under the slot they describe |
| Hard | Yes | Yes | Under the slot they describe |
| Expert | Yes | Yes | Shuffled, as in classic Mastermind |