Skip to main content

Algorithms for minesweeper.

Project description

ms_toollib

pypi MIT docs

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

Project details


Download files

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

Source Distribution

ms_toollib-1.5.9.tar.gz (283.5 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

ms_toollib-1.5.9-cp313-cp313t-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.13tWindows x86-64

ms_toollib-1.5.9-cp313-cp313t-win32.whl (2.2 MB view details)

Uploaded CPython 3.13tWindows x86

ms_toollib-1.5.9-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.13tmanylinux: glibc 2.17+ x86-64

ms_toollib-1.5.9-cp313-cp313t-manylinux_2_17_s390x.manylinux2014_s390x.whl (2.7 MB view details)

Uploaded CPython 3.13tmanylinux: glibc 2.17+ s390x

ms_toollib-1.5.9-cp313-cp313t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (3.0 MB view details)

Uploaded CPython 3.13tmanylinux: glibc 2.17+ ppc64le

ms_toollib-1.5.9-cp313-cp313t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (2.5 MB view details)

Uploaded CPython 3.13tmanylinux: glibc 2.17+ ARMv7l

ms_toollib-1.5.9-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.1 MB view details)

Uploaded CPython 3.13tmanylinux: glibc 2.17+ ARM64

ms_toollib-1.5.9-cp313-cp313t-manylinux_2_12_i686.manylinux2010_i686.whl (2.8 MB view details)

Uploaded CPython 3.13tmanylinux: glibc 2.12+ i686

ms_toollib-1.5.9-cp313-cp313t-macosx_11_0_arm64.whl (2.6 MB view details)

Uploaded CPython 3.13tmacOS 11.0+ ARM64

ms_toollib-1.5.9-cp313-cp313t-macosx_10_12_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.13tmacOS 10.12+ x86-64

ms_toollib-1.5.9-cp37-abi3-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.7+Windows x86-64

ms_toollib-1.5.9-cp37-abi3-win32.whl (2.2 MB view details)

Uploaded CPython 3.7+Windows x86

ms_toollib-1.5.9-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.17+ x86-64

ms_toollib-1.5.9-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl (2.8 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.17+ s390x

ms_toollib-1.5.9-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (3.0 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.17+ ppc64le

ms_toollib-1.5.9-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (2.5 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.17+ ARMv7l

ms_toollib-1.5.9-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.1 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.17+ ARM64

ms_toollib-1.5.9-cp37-abi3-manylinux_2_12_i686.manylinux2010_i686.whl (2.8 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.12+ i686

ms_toollib-1.5.9-cp37-abi3-macosx_11_0_arm64.whl (2.6 MB view details)

Uploaded CPython 3.7+macOS 11.0+ ARM64

ms_toollib-1.5.9-cp37-abi3-macosx_10_12_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.7+macOS 10.12+ x86-64

File details

Details for the file ms_toollib-1.5.9.tar.gz.

File metadata

  • Download URL: ms_toollib-1.5.9.tar.gz
  • Upload date:
  • Size: 283.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.13.3

File hashes

Hashes for ms_toollib-1.5.9.tar.gz
Algorithm Hash digest
SHA256 e7eee16927c90a117c1cde401989cae6b328c4e44abc256ad4c9af8074d78fa4
MD5 f98ea59a0bd7e37a57ab08e0e58cdb82
BLAKE2b-256 bd6466e3f6535fc9ec9db89c7956a60c1d87a1dfe89d04fe9612fd6471da0c0e

See more details on using hashes here.

File details

Details for the file ms_toollib-1.5.9-cp313-cp313t-win_amd64.whl.

File metadata

File hashes

Hashes for ms_toollib-1.5.9-cp313-cp313t-win_amd64.whl
Algorithm Hash digest
SHA256 a6d3b19d3236230a8fd226a43e1c324f041bed7041522fbfa9607a15f6c088cc
MD5 9208289525cce32cf8af201e567e27e2
BLAKE2b-256 ba58f2629e96ce7d708f3fc1fbd706b6eacc6b64d86e7145a89e190ec9d38962

See more details on using hashes here.

File details

Details for the file ms_toollib-1.5.9-cp313-cp313t-win32.whl.

File metadata

File hashes

Hashes for ms_toollib-1.5.9-cp313-cp313t-win32.whl
Algorithm Hash digest
SHA256 1c7966432815886b9d20db7526dce5d6e326b0b446b0e866e9ce5f6e8c328407
MD5 97973885f048124df05fab584e11ba0a
BLAKE2b-256 0ea47b51f9cb7277f30edad7380220ee1681d260ddda4bda228c0334ae867ec6

See more details on using hashes here.

File details

Details for the file ms_toollib-1.5.9-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ms_toollib-1.5.9-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e5e5d9dcc3ea47cc73f92e27db204827f493c38cda7d4b7218efead82698411f
MD5 7c8c2ec59bf1d70b4e2a2723c66ee4cf
BLAKE2b-256 68f9c107777f38bea9399f34272578f0b66a622017f3c3d1037de6ae0e627cb2

See more details on using hashes here.

File details

Details for the file ms_toollib-1.5.9-cp313-cp313t-manylinux_2_17_s390x.manylinux2014_s390x.whl.

File metadata

File hashes

Hashes for ms_toollib-1.5.9-cp313-cp313t-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 b953ec40074953c6ac087364818353a34c4a512bd4048454b00b26748f0c268c
MD5 b39d8c6acd7ac9929cb41a752c72acfe
BLAKE2b-256 66bad2add55f0efa3e4655ea00a31d52041a36b41fa56c860610c7affe7dafd2

See more details on using hashes here.

File details

Details for the file ms_toollib-1.5.9-cp313-cp313t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl.

File metadata

File hashes

Hashes for ms_toollib-1.5.9-cp313-cp313t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 bd92701a97abcdea8a5efe69ef05123d17f6af6b5926890d1a964782ba29569a
MD5 f3c18bf35678528803172384772e7ca2
BLAKE2b-256 0c8d4df27541a675bfda7317dca5fc1461438224d860b82cce1e913a3917c315

See more details on using hashes here.

File details

Details for the file ms_toollib-1.5.9-cp313-cp313t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for ms_toollib-1.5.9-cp313-cp313t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 36ac2b5cce471044b40a1f3ef1bc692f6ed7cde2e0ea17bdc774a77388d14648
MD5 82046c35681114b4be0dab62742abbdc
BLAKE2b-256 e4a8e1b3d7e6c1321a19e7844e440158f4f58acf596ca7a7e2d8aeae54e03791

See more details on using hashes here.

File details

Details for the file ms_toollib-1.5.9-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for ms_toollib-1.5.9-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 5f617d2284478d2d8055f17580a2d87b99d441192c0a5d11691261eaf9856923
MD5 ed6a85c10be24cf8c853eebce8b65d9d
BLAKE2b-256 f1678f6f6a8b48cc51b1fe33c9ffff6f4f499eb73b1b4dbdd724a1a663d076c2

See more details on using hashes here.

File details

Details for the file ms_toollib-1.5.9-cp313-cp313t-manylinux_2_12_i686.manylinux2010_i686.whl.

File metadata

File hashes

Hashes for ms_toollib-1.5.9-cp313-cp313t-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm Hash digest
SHA256 ab08d622f22655135c4b1e3e786c87eeb67da0186b4bcfd5e618773c4c069515
MD5 730b7b3df025b8a037897b7a895c1878
BLAKE2b-256 519c25ca8c891b2e49c811b14b015b2998419528b3c30535f930d1dcf03b8bb1

See more details on using hashes here.

File details

Details for the file ms_toollib-1.5.9-cp313-cp313t-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ms_toollib-1.5.9-cp313-cp313t-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5ea9e0908f853fe5b854c91ee265aa642f6135149afc7fdd576699ff2844ed46
MD5 66223ff64606e29e15b25e6ffb34d839
BLAKE2b-256 66286cbbe2f34099789b8a9b9c67f7469d55e9f3dd3f1f747625092891000b1d

See more details on using hashes here.

File details

Details for the file ms_toollib-1.5.9-cp313-cp313t-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for ms_toollib-1.5.9-cp313-cp313t-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 adbb27aa766b60f5616d01b9b7a53997d9c182f81195c27c95e4734ada36b8d0
MD5 9415167bc692b052336c7d114d95303d
BLAKE2b-256 7a416ab87f2e496d095af64e96104d736438f2529d72f313083a9b526b32fdf4

See more details on using hashes here.

File details

Details for the file ms_toollib-1.5.9-cp37-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for ms_toollib-1.5.9-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 f09c37c5e58773ad7c8c19833bf070645d1b980c700551d97b7a249def1ca73c
MD5 63a545b6e06be5ca18a739e66bf983df
BLAKE2b-256 4039f621db691244be11227b002f0c932af97e58c91f71fc28d7e2cd10fa177d

See more details on using hashes here.

File details

Details for the file ms_toollib-1.5.9-cp37-abi3-win32.whl.

File metadata

  • Download URL: ms_toollib-1.5.9-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

Hashes for ms_toollib-1.5.9-cp37-abi3-win32.whl
Algorithm Hash digest
SHA256 2092d4d5fedb35ebb16918d22f4ecf9491c33419d59a643e92ec309b45d80f99
MD5 e77411da1b0ff1e5bf2dfb0f38144d77
BLAKE2b-256 72e1f887daf4f5d89565f33af362531e819b5f664b2ff20ba43e35a534fb1192

See more details on using hashes here.

File details

Details for the file ms_toollib-1.5.9-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ms_toollib-1.5.9-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5792c5eb2bfe48b8798883a91406fa07e1ea92c264c590a40177218c40cebc92
MD5 b99ca093eab7f9f68627b5eb8e4f9845
BLAKE2b-256 04c69d197aab6456ba0c34a8e3423f7f7a84f6f17cc5995153fe43abf96bb5ba

See more details on using hashes here.

File details

Details for the file ms_toollib-1.5.9-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl.

File metadata

File hashes

Hashes for ms_toollib-1.5.9-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 09d06bf14ddc518aad82b4c7391854ac01091cb80a1ca364f1ca817533529fff
MD5 65d7bf708920a55069e021176d3c7bbd
BLAKE2b-256 4479f756815a797cf2aa60bd03b039f5193ac6d58d694ca7cb36934fdb40a14e

See more details on using hashes here.

File details

Details for the file ms_toollib-1.5.9-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl.

File metadata

File hashes

Hashes for ms_toollib-1.5.9-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 17b5af0d509dcc21a30bfe03a45d7889f40616cd73d2a5665926a225a3b2ca13
MD5 292013ac9e9e1137b8439e8b792a7136
BLAKE2b-256 84e26b42ea0237eb1305ac43c56b89545f983d0d2c9c3eef27c15e88bb8d8d74

See more details on using hashes here.

File details

Details for the file ms_toollib-1.5.9-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for ms_toollib-1.5.9-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 083af50fa92862fa9679122130bdd8e2e0997f9c67ea05fea1e3d9ae292504c4
MD5 59ec77831323d63de3cbe19eea8d089d
BLAKE2b-256 371781e335a8f4aed4d0af6f77ef99c07f512e4f821ad826e8432dac6aac9297

See more details on using hashes here.

File details

Details for the file ms_toollib-1.5.9-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for ms_toollib-1.5.9-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 0adae97ddfe430dd7f4a46be980aa5f5b53437a5228ba8e58ae68aa582d5b76c
MD5 e5b90a834e515d4f82e80790caf69e0e
BLAKE2b-256 ec5e380ed80b45a2a963d69f8260aa9ab1868521bc8ed1ff4c761e298afec6b9

See more details on using hashes here.

File details

Details for the file ms_toollib-1.5.9-cp37-abi3-manylinux_2_12_i686.manylinux2010_i686.whl.

File metadata

File hashes

Hashes for ms_toollib-1.5.9-cp37-abi3-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm Hash digest
SHA256 a4ffbb3097d995abdd14f7b5020529b7e757e38c482bbec0c79f246f651328e4
MD5 871cab338ae5e475048db980ef98e857
BLAKE2b-256 65fe81c819de5ae745d2326847a0ab8ab2fa55f111a34959a7c0528b2530f097

See more details on using hashes here.

File details

Details for the file ms_toollib-1.5.9-cp37-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ms_toollib-1.5.9-cp37-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 aa5c682b452a9997dc10d0a8366a477ee5157becd7744ae610833fc0c2355ed5
MD5 5bb9e5c71bec68a04dbbdf0518beb6db
BLAKE2b-256 60c2a62528c66b97387307bea0f6675d02e6979fbf94a597bd05c0c58fe05179

See more details on using hashes here.

File details

Details for the file ms_toollib-1.5.9-cp37-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for ms_toollib-1.5.9-cp37-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 8e719c54c69597781f0f6580027101cbbff71fd11a605cab1a2069b7837fab23
MD5 5324b00b8d7629870b5e0290a8d72b88
BLAKE2b-256 ec3625ef7a1b019edcb284b07cb121f618bccdde706fbf107ac8dc40184a84c7

See more details on using hashes here.

Supported by

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