Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

SWEEP TOGETHER!

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.

Core loop

  1. 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).
  2. Numbers tell you EXACTLY how many mines touch a cell; zero cells flood open their whole connected region plus the numbered border.
  3. Toggle FLAG MODE to mark suspected mines — flagged cells can't be clicked, so flags protect against fat fingers.
  4. Sweep every non-mine cell before 5:00 runs out to win the round. One mine ends it. New seeded field after either outcome.

Property-test contracts

  • 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.

Implementation catches

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.

Layout

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

Commands

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 Studio

CI runs tests, syntax checks, and a Rojo build on every push.

Known gaps (v0.1)

  • No chording (click-a-satisfied-number reveals neighbors)
  • Loss doesn't broadcast which flagged cells were wrong notes
  • No Studio playtest yet (human dependency)

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages