candycore/candy-mines 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

candy-mines

CandyMines

CI codecov Packagist Version License PHP

demo

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-05-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固