A browser-based memory game where players repeat an increasingly long sequence — implemented with explicit game state, timed playback, and clear feedback loops in vanilla JavaScript.
Simon-style games are a standard interview and learning exercise because they combine randomness, asynchronous playback, and strict input validation. My objective was to keep the rules obvious to a first-time player while keeping the implementation readable: a single source of truth for the sequence, explicit phases (playback vs input), and predictable reset behavior on mistakes.
The core model is an array representing the computer’s pattern plus an index for the player’s progress within the current round. Playback walks the array with delays between highlights so users can distinguish consecutive repeats. Input handlers compare each tap against the expected tile; mismatch triggers a short error animation and either restarts the round or decrements lives, depending on the rule set I locked in for the demo.
I isolated random tile selection and win/lose transitions into small functions so timing code stays separate from DOM updates — that separation made debugging off-by-one errors much faster.
HTML, CSS, JavaScript, and the DOM event model only — no React state or reducers. That constraint was intentional: it demonstrates comfort with asynchronous control flow using plain callbacks and setTimeout chains structured safely.
The playable build feels tight: inputs are ignored during playback so users cannot desync the round, and the UI always reflects the current phase. The main lesson was to document timing constants (playback speed, pause between tiles) in one place — tweaking “game feel” became a one-line change instead of a hunt through handlers.
Future work could add strict mode, high-score persistence, or haptic feedback on supported devices.