Minesweeper on the SugarCraft stack
Customisable board (width / height / mine count), recursive zero-flood-fill, win / lose detection. Pure-state Board class so every reveal is unit-testable without touching the runtime.
composer require candycore/candy-mines
./bin/candy-mines # 10×10, 12 mines (defaults)
./bin/candy-mines 16 16 40 # custom board
// Programmatic:
use CandyCore\Core\Program;
use CandyCore\Core\ProgramOptions;
use CandyCore\Mines\Game;
(new Program(Game::start(width: 16, height: 16, mines: 40),
new ProgramOptions(useAltScreen: true)))->run();
hjkl alongside arrows; cursor clamps at board edges.f flags / unflags the cursor cell; flagged cells can't be revealed by accident.isWon = every non-mine revealed; exploded = at least one mine was clicked.r reseeds with a fresh layout, preserving the chosen board size.VHS-recorded GIFs of every example shipped with the app. Regenerated automatically on every push that touches the source.