跳转到主要内容

使用Zig编写的扫雷求解器

项目描述

扫雷求解器

A minesweeper solver written in Zig.


The following cell representations are used for input boards:
- `#` for an unclicked cell
- `<N>` where `N=0,1,2,...` is a number shown in a cell
- `.` as an alternative to `0` (since the number 0 is not normally shown)
- `*` to represent a single mine (may be a revealed mine or a flag)
- `*<N>` where `N=1,2,...` is the number of mines


Example usage:
```
>>> import zig_minesolver
>>> board = """
... # 2 # # #
... # # # # #
... # 3 # # #
... # 2 # 4 #
... # # # # #
... """
>>> probs = zig_minesolver.get_board_probs(board, mines=8)
>>> print("

".join(str(x) for x in probs)) [0.27108, 0.0, 0.27108, 0.31325, 0.31325] [0.48594, 0.48594, 0.48594, 0.31325, 0.31325] [0.26506, 0.0, 0.50602, 0.5494, 0.5494] [0.26506, 0.0, 0.50602, 0.0, 0.5494] [0.10843, 0.10843, 0.24096, 0.5494, 0.5494] >>> ```

项目详情


下载文件

下载适合您平台的文件。如果您不确定选择哪个,请了解更多关于 安装包 的信息。

源代码分发

此发布版本没有可用的源代码分发文件。请参阅 生成分发存档的教程

构建分发

zig_minesolver-0.1.1-py3-none-win_amd64.whl (161.5 kB 查看哈希值)

上传时间: Python 3 Windows x86-64

zig_minesolver-0.1.1-py3-none-win32.whl (174.5 kB 查看哈希值)

上传于 Python 3 Windows x86

zig_minesolver-0.1.1-py3-none-manylinux1_x86_64.whl (432.3 kB 查看哈希值)

上传于 Python 3

zig_minesolver-0.1.1-py3-none-manylinux1_i686.whl (442.1 kB 查看哈希值)

上传于 Python 3

zig_minesolver-0.1.1-py3-none-macosx_11_0_arm64.whl (162.3 kB 查看哈希值)

上传于 Python 3 macOS 11.0+ ARM64

zig_minesolver-0.1.1-py3-none-macosx_10_9_x86_64.whl (174.8 kB 查看哈希值)

上传于 Python 3 macOS 10.9+ x86-64

支持者:

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面