Skip to main content

Minesweeper solver in Zig

Project description

Minesweeper solver

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] >>> ```

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

zig_minesolver-0.1.1-py3-none-win_amd64.whl (161.5 kB view hashes)

Uploaded Python 3 Windows x86-64

zig_minesolver-0.1.1-py3-none-win32.whl (174.5 kB view hashes)

Uploaded Python 3 Windows x86

zig_minesolver-0.1.1-py3-none-manylinux1_x86_64.whl (432.3 kB view hashes)

Uploaded Python 3

zig_minesolver-0.1.1-py3-none-manylinux1_i686.whl (442.1 kB view hashes)

Uploaded Python 3

zig_minesolver-0.1.1-py3-none-macosx_11_0_arm64.whl (162.3 kB view hashes)

Uploaded Python 3 macOS 11.0+ ARM64

zig_minesolver-0.1.1-py3-none-macosx_10_9_x86_64.whl (174.8 kB view hashes)

Uploaded Python 3 macOS 10.9+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page