← All projects

CodeBreaker

Mastermind in the browser, rewritten in TypeScript from a Python terminal game, with four difficulty levels and two-player pass-and-play.

  • TypeScript
  • Vite
  • Vitest
  • GitHub Actions

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

LevelBlank slotsRepeated colorsFeedback pegs
EasyNoNoUnder the slot they describe
MediumYesNoUnder the slot they describe
HardYesYesUnder the slot they describe
ExpertYesYesShuffled, as in classic Mastermind