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
Release history Release notifications | RSS feed
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
Close
Hashes for zig_minesolver-0.1.1-py3-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c98ef05ec2005be41e9e43e0aaa2a75c12deb65d9a5e43d510298fbe8949d9f3 |
|
MD5 | f2ceff5a0802cadde27249d3c320db4f |
|
BLAKE2b-256 | 0ff8c865325878396215365a1f5c6b48af0c162de7132a9db9887c1c9857816e |
Close
Hashes for zig_minesolver-0.1.1-py3-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54bc740a4e68fd6d44328421171a248fa366f6ad00a6fafc98f46a733b3be1d2 |
|
MD5 | 98e34278643ebbf331cfa72496186589 |
|
BLAKE2b-256 | 4cae0c4a9e9f52f6dff280cf8163033651a4f1adf70d1466836fbbef508db02e |
Close
Hashes for zig_minesolver-0.1.1-py3-none-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ff58842eff9055772ea6c0e3d558ac8155eee3bccf0aa3bec7734991aa797c3 |
|
MD5 | d859ff28f33413f7c7e68c1ba8f561f7 |
|
BLAKE2b-256 | 8b45e7fb179ebec23c68027dc9884fe228205958a4c92e0f6a8c6a4b1f74abd2 |
Close
Hashes for zig_minesolver-0.1.1-py3-none-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65a075131c86db96f73ef9eda96d53723441ffdc270fbde83c9f319e11e7576c |
|
MD5 | 3172df6988710ec6f9a98e4c01d35714 |
|
BLAKE2b-256 | 912cfe1402fd2128a036974a9e034c87bdcc170cd82c4a6fbaaa2355f49d8ff8 |
Close
Hashes for zig_minesolver-0.1.1-py3-none-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b53930432e426a373d1df163335803ac963d9264e5e2d0baecea182c542d586 |
|
MD5 | 35313cd372cf573da98db0385cb33607 |
|
BLAKE2b-256 | abab61c9ae0de77dd02b5858ce266914436f3ce5cbcf2da7e063d00169755445 |
Close
Hashes for zig_minesolver-0.1.1-py3-none-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d4f14e3787857c393c90a126e93c4ede26f88762f789617322eb96927fb38d44 |
|
MD5 | b58c82f847fbba9e2adc6c415d3a680c |
|
BLAKE2b-256 | 3905337c81a66fa46a9d03da0a0209ae45c4d1b46bce84c79eedf0f9e6537619 |