A tiny Wordle-like game where the answer is always HORSE.
After refactor, the app is split into clear modules:
src/components/— Presentational UI piecesHeader.jsx— App title and subtitleInstructions.jsx— How to play + legendGrid.jsx— The grid wrapper for all rowsGuessRow.jsx— One row of tilesTile.jsx— A single letter tileKeyboard.jsx— On-screen keyboardGameOverPanel.jsx— Win/Lose message and reset
src/hooks/useGameState.js— Encapsulates all game state and handlers
src/utils/scoreGuess.js— Wordle-like scoring algorithmkeyboardStatus.js— Merge letter statuses with priority
src/constants/game.js— Game constants: length, max guesses, target wordkeyboard.js— Keyboard layout and status priority
src/App.jsx— Composes everything togethersrc/main.jsx— App entry
npm install
npm run devOpen the printed local URL in your browser.
npm run buildThe production build goes to dist/.
- The refactor keeps behavior and styling the same, just splits logic into readable modules.
- Keyboard and grid animations are unchanged.
- The target word is fixed to
HORSE(by design).