Skip to content

MichalGrecer/Break_the_code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Crack the Code

A browser-based puzzle game inspired by the classic Mastermind and the popular Wordle. Guess the hidden code using logical deduction and colored clues! The game runs entirely on the client-side (in the browser), is fully responsive, and requires no database connection.

Play Now - Live Version


Screenshots

Gameplay showing smart keyboard and clues Post-game statistics and streak tracking


Main Features

  • Daily Challenge: A single, identical 4-digit code is generated for all players around the world every day. See how fast you can guess it and build your winning streak!
  • Smart Keyboard: The game automatically analyzes your moves and disables digits on the virtual keyboard that you are 100% sure are not in the passcode. This offloads your memory and lets you focus on deduction.
  • Unlimited Practice: Want to warm up? Turn on practice mode and choose the code length (3, 4, or 5 digits). Play as much as you want.
  • Local Statistics: The game tracks your win rate, guess distribution, and longest streak in the Daily Challenge. All data is safely stored in your browser's local storage (localStorage).
  • Mobile-First & Responsive: The UI scales smoothly to any screen size, taking into account safe areas for system keyboards on smartphones.
  • "Juice" & Animations: Satisfying tile flip animations, shake effects on errors, and a confetti blast upon winning.

How to Play

You have exactly 10 attempts to guess the secret code. After submitting each guess, the game will give you clues:

  • 🟩 Right places: The number of digits you guessed correctly and placed in the exact right position.
  • 🟨 Wrong places: The number of correct digits that are in the passcode but currently in the wrong position.

Note: Unlike Wordle, the tiles on the board do not change colors individually. You have to deduce for yourself which digits generated the green and yellow clues!


Technologies

Built using clean, core web technologies (zero heavy frameworks):

  • HTML5
  • CSS3 (utilizing clamp math functions, CSS variables, and Flexbox)
  • Vanilla JavaScript (ES6+)
  • External library: canvas-confetti (for visual effects)

Local Setup

Since the project has no backend, running it locally is incredibly simple:

  1. Clone this repository:
    git clone [https://github.com/MichalGrecer/Break_the_code.git](https://github.com/MichalGrecer/Break_the_code.git)
  2. Navigate to the project folder.
  3. Simply open the index.html file in any web browser.

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors