candycore/candy-mines
最新稳定版本:v0.2.0
Composer 安装命令:
composer create-project candycore/candy-mines
包简介
Minesweeper TUI — port of maxpaulus43/go-sweep on the SugarCraft stack.
README 文档
README
CandyMines
Minesweeper on the SugarCraft stack — port of maxpaulus43/go-sweep. Customisable board, recursive flood-fill, win / lose detection, vim-style movement.
Run it
composer install
./bin/candy-mines [width] [height] [mines] # defaults: 10 10 12
Keys
| Key | Action |
|---|---|
↑/↓/←/→ or hjkl |
Move cursor |
Space / Enter |
Reveal cell |
f |
Toggle flag |
r |
Restart with new mines |
q / Esc |
Quit |
Architecture
Three pure-state classes plus the runtime Model and a one-pass renderer:
| File | Role |
|---|---|
Cell |
Value object — mine / revealed / flagged / adjacent count |
Board |
The grid + every transition (reveal, flag, flood-fill). PRNG injected as Closure(int):int for deterministic tests |
Game (Model) |
Cursor + key routing + restart + win/lose gate |
Renderer |
Pure view function. CandySprinkles Style + Border::rounded() |
The first reveal is always safe — mines are placed only after click 1, with the clicked cell's 3×3 neighbourhood excluded so the player gets a non-trivial flood-fill on every game.
Test
composer install vendor/bin/phpunit
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 7
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-05-07
