Minefield Sweep
JavaScript mine puzzle with delayed mines, recursive reveal, flag mode, difficulty, timer/best time, and labeled cells.
- Status
- Accessible prototype / live demo
- Last updated
- May 2026
- Controls
- Reveal cells, mark suspected mines, switch difficulty, and clear the field without triggering a mine.
- Keyboard
- Focus a cell, Arrow to move, Enter/Space reveals, F flags, and P/Escape pauses.
- Touch
- Tap to reveal, use Flag Mode to mark mines, and use Scout/Ranger/Warden buttons for difficulty.
- Accessibility
- The minefield is a keyboard-navigable board with live status, mines-left, timer, best-time, and cleared-percentage readouts.
Ready
Minefield ready.
Keyboard and touch controls
Keyboard shortcuts
- Arrow keysMove focus between cells on the board.
- Enter / SpaceReveal the focused cell, or flag it when Flag Mode is on.
- FToggle a flag on the focused cell.
- P / EscPause or resume the current field.
- Difficulty arrowsMove between Scout, Ranger, and Warden when difficulty buttons are focused.
Touch controls
- Tap cellReveal a cell in sweep mode.
- Flag ModeTurn it on, then tap cells to place or remove flags.
- Difficulty buttonsChoose Scout, Ranger, or Warden before or between fields.
Board generation, reveal flow, and accessible cell state.
Main state tracks difficulty, mines, cells, flags, timer, progress, and status. First reveal is safe; later reveals expand, count, flag, and finish.
Mine placement, reveal logic, and accessible board state.
- Implemented delayed mine placement, safe first reveal, adjacent counts, recursive empty-cell reveal, flag toggling, and win/loss state.
- Built difficulty switching, timer/best-time persistence, mines-left tracking, cleared-percent updates, pause/restart controls, and touch flag mode.
- Rendered the board as a keyboard-navigable grid with roving focus, row/column labels, live announcements, and state-specific cell descriptions.
Minesweeper-style rules are the reference; this board generation, reveal state, difficulty model, and UI treatment are custom code.
Accessible prototype with testable logic still to add.
Solid: safe reveal, recursive clearing, flags, keyboard navigation, and labels. Hardening: reveal tests, focus checks, validation, and assistive-tech QA.
Static logic game with difficulty config in source.
GitHub Pages serves minefield-sweep.html, minefield-sweep.css, and minefield-sweep.js. No env vars or external APIs beyond browser events and LocalStorage. Local: run python -m http.server 8000 and open /minefield-sweep.html.