Cooperative Minesweeper for Roblox — the classic deduction-puzzle genre on a shared physical board, rebuilt as pure property-tested laws: deferred seeded generation with a guaranteed-safe opening, exact flood-fill closure, flags as protected notes, and a count-exact win condition.
- A 12×12 field of unopened cells. The FIRST click of every round is ALWAYS safe — mines are only placed after it, excluded from that cell plus all 8 neighbors (even in corners).
- Numbers tell you EXACTLY how many mines touch a cell; zero cells flood open their whole connected region plus the numbered border.
- Toggle FLAG MODE to mark suspected mines — flagged cells can't be clicked, so flags protect against fat fingers.
- Sweep every non-mine cell before 5:00 runs out to win the round. One mine ends it. New seeded field after either outcome.
- Generation law: exactly MineCount mines across 200 seeds with ZERO inside the clicked cell's ≤9-cell safe zone (corner clicks tested — edges truncate correctly); same (seed, safeCell) → identical mine maps and counts.
- Neighbor-count law: every non-mine cell's count equals its exact mine-adjacency over all ≤8 neighbors (50-board sweep).
- Reveal law: numbered reveals open EXACTLY one cell; zero reveals open the full closure with a leak invariant — no hidden zero may ever touch an already-revealed zero; reveals are MONOTONE (re-clicks open nothing); no flood ever auto-reveals a mine (60-seed sweep).
- Flag law: hidden→flagged→hidden cycle; revealed cells reject flags; flagged mines are immune to losing clicks.
- Win law: victory iff revealed == safe cells — count-exact, tested at N−1 (not won), N (won); flag states never enter the check.
The server had a malformed if cond { } block (C-braces leaked into
Lua) around the loss gate AND a RevealAllMines forward-reference that
would resolve to a nil global mid-game — both caught in review before
shipping. Flag routing went through a per-player server-side FLAG MODE
switch rather than trusting client click modes.
src/shared/ Config + SweepMath (generation/count/reveal/flag/win laws)
src/server/ Remotes + SweepService (deferred board truth, lazy first-
click placement, per-player flag mode)
src/client/ Network + timer/feed HUD + FLAG MODE toggle
tests/ lune headless specs (12) incl. 200-seed safety sweep
lune run tests/run_tests.luau # unit tests
lune run tests/syntax_check.luau # compile-check all sources
rojo build -o sweep-together.rbxlx # validate project mapping
rojo serve # live-sync into StudioCI runs tests, syntax checks, and a Rojo build on every push.
- No chording (click-a-satisfied-number reveals neighbors)
- Loss doesn't broadcast which flagged cells were wrong notes
- No Studio playtest yet (human dependency)