Algorithms for minesweeper.
Project description
ms_toollib
A cross-platform minesweeper algorithm toolbox with a native Rust core.
Supports Python 3.7–3.13 on Windows, Linux, and macOS.
Installation
pip install ms_toollib
No additional dependencies required.
Features
| Category | Description |
|---|---|
| Mine Laying | Random mine placement (first-click safe, Win7-style), no-guess mine generation (filter & adjustment methods) |
| Board Metrics | 3BV, 3BV/s, openings (Op), islands (Isl), ZiNi (Greedy/Human/Random) |
| Probabilities | Per-cell mine probability with block decomposition and enumeration |
| Deduction Solver | 3-tier solver: direct subset, subtract-and-compare, full enumeration (≤55 cells) |
| Solvability Check | Determine if a board is no-guess, find unsolvable structures |
| Game State Machine | MinesweeperBoard / SafeMinesweeperBoard that accepts mouse clicks and tracks full game state |
| Replay Parsing | Read AVF, EVF, MVF, RMV formats; save/write EVF (v0–v4) and EVFS containers |
| Optical Recognition | Recognize board state from an RGBA image via ONNX neural network (Sobel, Hough, DP) |
Quick Start
import ms_toollib as ms
# Generate a no-guess Beginner board
board = ms.laymine_solvable(9, 9, 10)
print(ms.cal_bbbv(board)) # 3BV
print(ms.cal_zini(board, 1)) # Greedy ZiNi
# Per-cell mine probability
prob = ms.cal_probability_onboard(board, 10)
# Parse a replay
video = ms.AvfVideo("replay.avf")
video.parse()
video.analyse()
print(video.bbbv)
See the full documentation for detailed API references.
Public API
Functions (30+):
cal_all_solution, cal_bbbv, cal_board_numbers, cal_hzini, cal_op, cal_probability, cal_probability_onboard, cal_rzini, cal_zini, get_all_not_and_is_mine_on_board, is_able_to_solve, is_guess_while_needless, is_solvable, laymine, laymine_op, laymine_solvable, laymine_solvable_adjust, laymine_solvable_thread, mark_board, obr_board, refresh_board, refresh_matrix, refresh_matrixs, refresh_matrixses, sample_bbbvs_exp, solve_direct, solve_enumerate, solve_minus, unsolvable_structure, valid_time_period
Classes (15):
AvfVideo, BaseVideo, Board, EvfVideo, Evfs, EvfsCell, GameBoard, KeyDynamicParams, MinesweeperBoard, MvfVideo, RmvVideo, SafeBoard, SafeBoardRow, SafeMinesweeperBoard, VideoActionStateRecorder
Supported Platforms
| OS | Architectures |
|---|---|
| Windows | x86, x64 |
| Linux | x86, x86_64, aarch64, armv7, ppc64le, s390x |
| macOS | x86_64, aarch64 |
Source & Issues
- GitHub: https://github.com/eee555/ms_toollib
- Documentation: https://docs.rs/ms_toollib/latest/ms_toollib
- PyPI: https://pypi.org/project/ms_toollib/
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 Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ms_toollib-1.5.10.tar.gz.
File metadata
- Download URL: ms_toollib-1.5.10.tar.gz
- Upload date:
- Size: 284.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac37f10b9822c51132c380c5d8eeb856b518982c00e9f6a3952907c1e83c8726
|
|
| MD5 |
f9b78e71d3ae56b20c30ba9a93396480
|
|
| BLAKE2b-256 |
efd6e59c32ff1cc1d1246f7f3c2f8a5b73184efc36e6b0232ebc1dbebe4d55e1
|
File details
Details for the file ms_toollib-1.5.10-cp313-cp313t-win_amd64.whl.
File metadata
- Download URL: ms_toollib-1.5.10-cp313-cp313t-win_amd64.whl
- Upload date:
- Size: 2.7 MB
- Tags: CPython 3.13t, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c68bb50c5e1fa966e571ef9daebf2eebfa83c17e2ae64f552ec9652c9f3b941
|
|
| MD5 |
bac9106734f7f55f9be15d8af442d7d5
|
|
| BLAKE2b-256 |
b20c39926fa5bd44537cec987873593609b84cc4a6de9e474119e7f3170d2a9b
|
File details
Details for the file ms_toollib-1.5.10-cp313-cp313t-win32.whl.
File metadata
- Download URL: ms_toollib-1.5.10-cp313-cp313t-win32.whl
- Upload date:
- Size: 2.2 MB
- Tags: CPython 3.13t, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
35289c5bb83e1935b75de003686377f765f6225d017471b3b92a2a80b572ddbd
|
|
| MD5 |
be9b30538486fd0467658f6c3bec58fd
|
|
| BLAKE2b-256 |
aa5aa157677ef4e4a56dcb9a08e739c083cfce6978b2498b8db2ba9eb6444c6a
|
File details
Details for the file ms_toollib-1.5.10-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: ms_toollib-1.5.10-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 3.1 MB
- Tags: CPython 3.13t, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
088e53036e295951fecd2f3f80caf22ab37f723a4c37e8fb1b286708f4fa2be0
|
|
| MD5 |
2afe72c50572e0953ca555ab697e9348
|
|
| BLAKE2b-256 |
f37b1e98b4a717f3b82a1f5ea01ad1e90ad4af0d0751f71dd85df0057b36aca9
|
File details
Details for the file ms_toollib-1.5.10-cp313-cp313t-manylinux_2_17_s390x.manylinux2014_s390x.whl.
File metadata
- Download URL: ms_toollib-1.5.10-cp313-cp313t-manylinux_2_17_s390x.manylinux2014_s390x.whl
- Upload date:
- Size: 2.7 MB
- Tags: CPython 3.13t, manylinux: glibc 2.17+ s390x
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aaf052c75f6748545090a86978583db5f4575aa793da30c6bc4c3cb62d71c378
|
|
| MD5 |
fbfc7f2e38d8752bbeed2737b6652345
|
|
| BLAKE2b-256 |
51da717f30555974658e3e737e88b639779e663ac2a957053db64c100393492c
|
File details
Details for the file ms_toollib-1.5.10-cp313-cp313t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl.
File metadata
- Download URL: ms_toollib-1.5.10-cp313-cp313t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
- Upload date:
- Size: 3.0 MB
- Tags: CPython 3.13t, manylinux: glibc 2.17+ ppc64le
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5fbf86aaf94e51580367d4dacdaeb3bd8ab70c0c7aae6065c1a297ecce8eeb4c
|
|
| MD5 |
c5fd9547d3f6bd25100e1b1f227bbdf4
|
|
| BLAKE2b-256 |
1e4405117de24e38a4b18e7384789bdc34977f9dea0d8d84ff12e42e51b2ab28
|
File details
Details for the file ms_toollib-1.5.10-cp313-cp313t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.
File metadata
- Download URL: ms_toollib-1.5.10-cp313-cp313t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
- Upload date:
- Size: 2.5 MB
- Tags: CPython 3.13t, manylinux: glibc 2.17+ ARMv7l
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e07ea99eb35dab0fbcefaab9b6c2d9cbcb0556f70794278a79ee1696928bc67
|
|
| MD5 |
78c9286a0388cae3fefa17f5b9ff0051
|
|
| BLAKE2b-256 |
78db73ad5a662f0b6217964dfa127c4c8029c92f1500430ef674812f0a19f4bf
|
File details
Details for the file ms_toollib-1.5.10-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: ms_toollib-1.5.10-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 3.1 MB
- Tags: CPython 3.13t, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9adaa67a936a17600de8c7564e252eaf15ec37893ce9def1d9c07e0463a121d7
|
|
| MD5 |
3bf4ac6793bd8659ba713098c18b2631
|
|
| BLAKE2b-256 |
8b2fdb0d87e096b09df2eb82c986589ff2d2c14662097c68ccbe29208b513188
|
File details
Details for the file ms_toollib-1.5.10-cp313-cp313t-manylinux_2_12_i686.manylinux2010_i686.whl.
File metadata
- Download URL: ms_toollib-1.5.10-cp313-cp313t-manylinux_2_12_i686.manylinux2010_i686.whl
- Upload date:
- Size: 2.8 MB
- Tags: CPython 3.13t, manylinux: glibc 2.12+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
47c1ab88c5fce7e856162b0da68241183213043835ec55aef8817cbc191eba88
|
|
| MD5 |
2b483e69cbee3f911606175714cb9d58
|
|
| BLAKE2b-256 |
d9e1e7ec828e7785cba570546a30089407ec796a31839546a7c893af1d2d1737
|
File details
Details for the file ms_toollib-1.5.10-cp313-cp313t-macosx_11_0_arm64.whl.
File metadata
- Download URL: ms_toollib-1.5.10-cp313-cp313t-macosx_11_0_arm64.whl
- Upload date:
- Size: 2.5 MB
- Tags: CPython 3.13t, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4dc799f708c0e5a785c74290a02b4e56a3ed1a390788896cdf481d045552b2af
|
|
| MD5 |
38625ec7ff341792475d69771ca99d09
|
|
| BLAKE2b-256 |
ea2bc9b339213244e335199876daeb271af243a5a72e6e84cda4ec49fa671a42
|
File details
Details for the file ms_toollib-1.5.10-cp313-cp313t-macosx_10_12_x86_64.whl.
File metadata
- Download URL: ms_toollib-1.5.10-cp313-cp313t-macosx_10_12_x86_64.whl
- Upload date:
- Size: 2.7 MB
- Tags: CPython 3.13t, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a52732cfc900203e0747211c684a70bf4cc3925a37340d1abbe5e75b875929d3
|
|
| MD5 |
0e628e9eb4953adf73522fa0646227e3
|
|
| BLAKE2b-256 |
4670a1ee6b551b2c7215e783dfc5923e1703084f22fb4a1b0d899a5018df546c
|
File details
Details for the file ms_toollib-1.5.10-cp37-abi3-win_amd64.whl.
File metadata
- Download URL: ms_toollib-1.5.10-cp37-abi3-win_amd64.whl
- Upload date:
- Size: 2.7 MB
- Tags: CPython 3.7+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7f1829397b481b20f7307ed44f1b06ff9d8848ea360c8f773341f4d4414d5759
|
|
| MD5 |
f45d534b85d19af8d754e798ca26311b
|
|
| BLAKE2b-256 |
94077fec539db707689ca609b28a5a9e69bc229b271227cc92117710476b56e7
|
File details
Details for the file ms_toollib-1.5.10-cp37-abi3-win32.whl.
File metadata
- Download URL: ms_toollib-1.5.10-cp37-abi3-win32.whl
- Upload date:
- Size: 2.2 MB
- Tags: CPython 3.7+, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc773150d59b67a2745aa6fb2504a5736e9e93098348006f82b0501fe137e912
|
|
| MD5 |
7ca07b263616aa12b4604483cfe7ba63
|
|
| BLAKE2b-256 |
8436f079addca01f8d9646010df258196a292d658c740df1918c41cfcc3147d4
|
File details
Details for the file ms_toollib-1.5.10-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: ms_toollib-1.5.10-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 3.1 MB
- Tags: CPython 3.7+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9e21cc826616e1dbea2df747c97d48d1d392744886ec4f3317838ceab071307
|
|
| MD5 |
599da80ab6d417ddc89f531d4afe85dd
|
|
| BLAKE2b-256 |
a2e3db9ec115bd2920c0b800a66e8ade54890c6d8290b808c9bccf49f47da97f
|
File details
Details for the file ms_toollib-1.5.10-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl.
File metadata
- Download URL: ms_toollib-1.5.10-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
- Upload date:
- Size: 2.7 MB
- Tags: CPython 3.7+, manylinux: glibc 2.17+ s390x
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e68a152aa6bd92b8dce3a77738e88e5da13eadc9ad0ad3bff1eda53f5c2e824f
|
|
| MD5 |
3067a1ac1b7de811688f5e7e282b2b22
|
|
| BLAKE2b-256 |
0c5a0a4fb92acb925cbdae2eeb3b6b5c89d1534220ad88a13a392aea0914c520
|
File details
Details for the file ms_toollib-1.5.10-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl.
File metadata
- Download URL: ms_toollib-1.5.10-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
- Upload date:
- Size: 3.0 MB
- Tags: CPython 3.7+, manylinux: glibc 2.17+ ppc64le
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3fc7d184efe38bdc6b68af36e83bd8bb05298bbb5b0f1b32ef8754b9e98d07f2
|
|
| MD5 |
400e7e2c2cc4bdaf465a46393f841c60
|
|
| BLAKE2b-256 |
28dbed3ee08125c28958367a88145cb026eafc067cbbad73fbf1da22c50d8c8d
|
File details
Details for the file ms_toollib-1.5.10-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.
File metadata
- Download URL: ms_toollib-1.5.10-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
- Upload date:
- Size: 2.5 MB
- Tags: CPython 3.7+, manylinux: glibc 2.17+ ARMv7l
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
34131242983a3e1cc5b89619b3da82909d32af425e33bd7a2c244534c5e57415
|
|
| MD5 |
e5c739bbf2bcdf5f4a3e2c691b7e8355
|
|
| BLAKE2b-256 |
2bf5785fc68b14d8f838304d850e56de8ba0c2d54e06f30758e600a8065252a3
|
File details
Details for the file ms_toollib-1.5.10-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: ms_toollib-1.5.10-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 3.1 MB
- Tags: CPython 3.7+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bad2b914915b1891b7e8775bcc88844a262d3cd47438f43cc177854d81ddd0b1
|
|
| MD5 |
03b063b2f862553d0257df2765dda0aa
|
|
| BLAKE2b-256 |
4fea2c417076e8d7b77f00cca33eee03deecfd5e7a21638faff61921744b07dd
|
File details
Details for the file ms_toollib-1.5.10-cp37-abi3-manylinux_2_12_i686.manylinux2010_i686.whl.
File metadata
- Download URL: ms_toollib-1.5.10-cp37-abi3-manylinux_2_12_i686.manylinux2010_i686.whl
- Upload date:
- Size: 2.8 MB
- Tags: CPython 3.7+, manylinux: glibc 2.12+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1715ad3944fc9b6bc675761fd041a0cdbaf3ba378d3924315080fb763e2c0393
|
|
| MD5 |
3d66a84cfef3057a7e133234bbe4cee5
|
|
| BLAKE2b-256 |
8d83465dba1892fe6a7cb9ec0aa1337d17789ff6c811cf6e68466668ab1b7658
|
File details
Details for the file ms_toollib-1.5.10-cp37-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: ms_toollib-1.5.10-cp37-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 2.6 MB
- Tags: CPython 3.7+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2afa4f52dfb80c51aa9b7a6f5e674f337d99ededd75c62071a4ad378440dbcb4
|
|
| MD5 |
de42bf52136059b5ff76108c7fcfe3a9
|
|
| BLAKE2b-256 |
dbfe637d75f523fde418626656243c464f6f67aa4186fb3b4542f3b5056ec212
|
File details
Details for the file ms_toollib-1.5.10-cp37-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: ms_toollib-1.5.10-cp37-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 2.7 MB
- Tags: CPython 3.7+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
812a95028676e3641a4801c2f99fc9631278937f61efc7b03f8e757bbe0ff26c
|
|
| MD5 |
36c7dbc3203e0515f9052aa537f28a8c
|
|
| BLAKE2b-256 |
5f53bbd2960df31e6df4a50fa35935cda6f344d427694545658fdf49ac3e6e42
|