puzzlekit 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- puzzlekit-0.1.0/LICENSE +21 -0
- puzzlekit-0.1.0/MANIFEST.in +9 -0
- puzzlekit-0.1.0/PKG-INFO +257 -0
- puzzlekit-0.1.0/README.md +206 -0
- puzzlekit-0.1.0/pyproject.toml +42 -0
- puzzlekit-0.1.0/setup.cfg +4 -0
- puzzlekit-0.1.0/src/.DS_Store +0 -0
- puzzlekit-0.1.0/src/puzzlekit/.DS_Store +0 -0
- puzzlekit-0.1.0/src/puzzlekit/__init__.py +12 -0
- puzzlekit-0.1.0/src/puzzlekit/__pycache__/__init__.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/core/__init__.py +0 -0
- puzzlekit-0.1.0/src/puzzlekit/core/__pycache__/__init__.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/core/__pycache__/direction.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/core/__pycache__/displayer.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/core/__pycache__/grid.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/core/__pycache__/position.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/core/__pycache__/regionsgrid.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/core/__pycache__/result.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/core/__pycache__/solver.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/core/direction.py +107 -0
- puzzlekit-0.1.0/src/puzzlekit/core/grid.py +197 -0
- puzzlekit-0.1.0/src/puzzlekit/core/position.py +173 -0
- puzzlekit-0.1.0/src/puzzlekit/core/regionsgrid.py +51 -0
- puzzlekit-0.1.0/src/puzzlekit/core/result.py +49 -0
- puzzlekit-0.1.0/src/puzzlekit/core/solver.py +211 -0
- puzzlekit-0.1.0/src/puzzlekit/parsers/__init__.py +4 -0
- puzzlekit-0.1.0/src/puzzlekit/parsers/__pycache__/__init__.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/parsers/__pycache__/common.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/parsers/__pycache__/registry.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/parsers/common.py +422 -0
- puzzlekit-0.1.0/src/puzzlekit/parsers/registry.py +87 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__init__.py +169 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/__init__.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/abc_end_view.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/akari.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/balance_loop.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/binairo.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/bosanowa.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/buraitoraito.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/butterfly_sudoku.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/clueless_1_sudoku.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/clueless_2_sudoku.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/country_road.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/detour.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/dominos.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/double_back.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/entry_exit.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/eulero.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/even_odd_sudoku.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/fobidoshi.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/fuzili.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/fuzuli.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/gappy.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/gattai_8_sudoku.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/grand_tour.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/hakyuu.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/heyawake.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/hitori.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/jigsaw_sudoku.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/kakurasu.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/kakuro.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/killer_sudoku.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/kuroshuto.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/linesweeper.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/magnetic.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/masyu.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/minesweeper.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/mosaic.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/munraito.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/nondango.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/nonogram.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/norinori.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/one_to_x.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/patchwork.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/pfeilzahlen.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/pills.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/registry.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/renban.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/samurai_sudoku.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/shikaku.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/shogun_sudoku.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/simple_loop.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/slitherlink.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/sohei_sudoku.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/square_o.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/starbattle.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/str8t.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/sudoku.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/suguru.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/sumo_sudoku.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/tenner_grid.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/tent.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/terra_x.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/thermometer.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/tile_paint.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/windmill_sudoku.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/__pycache__/yajilin.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/abc_end_view.py +145 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/akari.py +96 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/balance_loop.py +184 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/binairo.py +89 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/bosanowa.py +62 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/buraitoraito.py +54 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/butterfly_sudoku.py +68 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/clueless_1_sudoku.py +81 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/clueless_2_sudoku.py +89 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/country_road.py +108 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/detour.py +111 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/dominos.py +84 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/double_back.py +95 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/entry_exit.py +92 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/eulero.py +74 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/even_odd_sudoku.py +72 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/fobidoshi.py +75 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/fuzuli.py +161 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/gappy.py +106 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/gattai_8_sudoku.py +65 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/grand_tour.py +104 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/hakyuu.py +111 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/heyawake.py +125 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/hitori.py +105 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/jigsaw_sudoku.py +59 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/kakurasu.py +53 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/kakuro.py +75 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/killer_sudoku.py +73 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/kuroshuto.py +85 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/linesweeper.py +85 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/magnetic.py +118 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/masyu.py +192 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/minesweeper.py +59 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/mosaic.py +44 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/munraito.py +188 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/nondango.py +75 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/nonogram.py +224 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/norinori.py +55 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/one_to_x.py +69 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/patchwork.py +73 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/pfeilzahlen.py +133 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/pills.py +99 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/renban.py +83 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/samurai_sudoku.py +66 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/shikaku.py +87 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/shogun_sudoku.py +66 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/simple_loop.py +82 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/slitherlink.py +120 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/sohei_sudoku.py +66 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/square_o.py +62 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/starbattle.py +86 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/str8t.py +159 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/sudoku.py +62 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/suguru.py +59 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/sumo_sudoku.py +74 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/tenner_grid.py +60 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/tent.py +70 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/terra_x.py +63 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/thermometer.py +94 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/tile_paint.py +60 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/windmill_sudoku.py +67 -0
- puzzlekit-0.1.0/src/puzzlekit/solvers/yajilin.py +126 -0
- puzzlekit-0.1.0/src/puzzlekit/utils/__init__.py +0 -0
- puzzlekit-0.1.0/src/puzzlekit/utils/__pycache__/__init__.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/utils/__pycache__/name_utils.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/utils/__pycache__/ortools_utils.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/utils/__pycache__/puzzle_math.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/utils/file_loader.py +20 -0
- puzzlekit-0.1.0/src/puzzlekit/utils/name_utils.py +29 -0
- puzzlekit-0.1.0/src/puzzlekit/utils/ortools_utils.py +230 -0
- puzzlekit-0.1.0/src/puzzlekit/utils/puzzle_math.py +63 -0
- puzzlekit-0.1.0/src/puzzlekit/verifiers/__init__.py +74 -0
- puzzlekit-0.1.0/src/puzzlekit/verifiers/__pycache__/__init__.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/verifiers/__pycache__/common.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/verifiers/common.py +93 -0
- puzzlekit-0.1.0/src/puzzlekit/viz/__init__.py +124 -0
- puzzlekit-0.1.0/src/puzzlekit/viz/__pycache__/__init__.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/viz/__pycache__/base.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/viz/__pycache__/drawers.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/src/puzzlekit/viz/base.py +209 -0
- puzzlekit-0.1.0/src/puzzlekit/viz/drawers.py +263 -0
- puzzlekit-0.1.0/src/puzzlekit.egg-info/PKG-INFO +257 -0
- puzzlekit-0.1.0/src/puzzlekit.egg-info/SOURCES.txt +315 -0
- puzzlekit-0.1.0/src/puzzlekit.egg-info/dependency_links.txt +1 -0
- puzzlekit-0.1.0/src/puzzlekit.egg-info/requires.txt +4 -0
- puzzlekit-0.1.0/src/puzzlekit.egg-info/top_level.txt +1 -0
- puzzlekit-0.1.0/tests/.DS_Store +0 -0
- puzzlekit-0.1.0/tests/__init__.py +0 -0
- puzzlekit-0.1.0/tests/__pycache__/__init__.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/__init__.cpython-311.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_abc_end_view.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_akari.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_akari.cpython-311-pytest-7.4.0.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_balance_loop.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_binairo.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_binairo.cpython-311-pytest-7.4.0.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_bosanowa.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_buraitoraito.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_butterfly_sudoku.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_clueless_1_sudoku.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_clueless_2_sudoku.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_country_road.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_detour.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_dominos.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_double_back.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_entry_exit.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_eulero.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_even_odd_sudoku.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_fobidoshi.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_fuzili.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_fuzuli.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_gappy.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_gattai_8_sudoku.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_grand_tour.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_grid.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_grid.cpython-310.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_hakyuu.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_heyawake.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_hitori.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_jigsaw_sudoku.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_kakurasu.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_kakuro.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_killer_sudoku.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_kuroshuto.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_linesweeper.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_magnetic.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_masyu.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_minesweeper.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_mosaic.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_munraito.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_nondango.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_nonogram.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_norinori.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_one_to_x.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_patchwork.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_pfeilzahlen.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_pills.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_renban.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_samurai_sudoku.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_shikaku.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_shogun_sudoku.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_simple_loop.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_slitherlink.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_sohei_sudoku.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_square_o.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_starbattle.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_str8t.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_sudoku.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_suguru.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_sumo_sudoku.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_tenner_grid.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_tent.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_terra_x.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_thermometer.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_tile_paint.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_windmill_sudoku.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/__pycache__/test_yajilin.cpython-310-pytest-9.0.2.pyc +0 -0
- puzzlekit-0.1.0/tests/test_abc_end_view.py +189 -0
- puzzlekit-0.1.0/tests/test_akari.py +68 -0
- puzzlekit-0.1.0/tests/test_balance_loop.py +74 -0
- puzzlekit-0.1.0/tests/test_binairo.py +74 -0
- puzzlekit-0.1.0/tests/test_bosanowa.py +67 -0
- puzzlekit-0.1.0/tests/test_buraitoraito.py +77 -0
- puzzlekit-0.1.0/tests/test_butterfly_sudoku.py +82 -0
- puzzlekit-0.1.0/tests/test_clueless_1_sudoku.py +22 -0
- puzzlekit-0.1.0/tests/test_clueless_2_sudoku.py +22 -0
- puzzlekit-0.1.0/tests/test_country_road.py +78 -0
- puzzlekit-0.1.0/tests/test_detour.py +78 -0
- puzzlekit-0.1.0/tests/test_dominos.py +49 -0
- puzzlekit-0.1.0/tests/test_double_back.py +63 -0
- puzzlekit-0.1.0/tests/test_entry_exit.py +63 -0
- puzzlekit-0.1.0/tests/test_eulero.py +57 -0
- puzzlekit-0.1.0/tests/test_even_odd_sudoku.py +61 -0
- puzzlekit-0.1.0/tests/test_fobidoshi.py +78 -0
- puzzlekit-0.1.0/tests/test_fuzuli.py +69 -0
- puzzlekit-0.1.0/tests/test_gappy.py +54 -0
- puzzlekit-0.1.0/tests/test_gattai_8_sudoku.py +22 -0
- puzzlekit-0.1.0/tests/test_grand_tour.py +22 -0
- puzzlekit-0.1.0/tests/test_grid.py +111 -0
- puzzlekit-0.1.0/tests/test_hakyuu.py +23 -0
- puzzlekit-0.1.0/tests/test_heyawake.py +23 -0
- puzzlekit-0.1.0/tests/test_hitori.py +22 -0
- puzzlekit-0.1.0/tests/test_jigsaw_sudoku.py +23 -0
- puzzlekit-0.1.0/tests/test_kakurasu.py +24 -0
- puzzlekit-0.1.0/tests/test_kakuro.py +22 -0
- puzzlekit-0.1.0/tests/test_killer_sudoku.py +23 -0
- puzzlekit-0.1.0/tests/test_kuroshuto.py +22 -0
- puzzlekit-0.1.0/tests/test_linesweeper.py +22 -0
- puzzlekit-0.1.0/tests/test_magnetic.py +27 -0
- puzzlekit-0.1.0/tests/test_masyu.py +22 -0
- puzzlekit-0.1.0/tests/test_minesweeper.py +23 -0
- puzzlekit-0.1.0/tests/test_mosaic.py +22 -0
- puzzlekit-0.1.0/tests/test_munraito.py +22 -0
- puzzlekit-0.1.0/tests/test_nondango.py +23 -0
- puzzlekit-0.1.0/tests/test_nonogram.py +24 -0
- puzzlekit-0.1.0/tests/test_norinori.py +23 -0
- puzzlekit-0.1.0/tests/test_one_to_x.py +26 -0
- puzzlekit-0.1.0/tests/test_patchwork.py +23 -0
- puzzlekit-0.1.0/tests/test_pfeilzahlen.py +22 -0
- puzzlekit-0.1.0/tests/test_pills.py +24 -0
- puzzlekit-0.1.0/tests/test_renban.py +23 -0
- puzzlekit-0.1.0/tests/test_samurai_sudoku.py +22 -0
- puzzlekit-0.1.0/tests/test_shikaku.py +22 -0
- puzzlekit-0.1.0/tests/test_shogun_sudoku.py +22 -0
- puzzlekit-0.1.0/tests/test_simple_loop.py +22 -0
- puzzlekit-0.1.0/tests/test_slitherlink.py +22 -0
- puzzlekit-0.1.0/tests/test_sohei_sudoku.py +22 -0
- puzzlekit-0.1.0/tests/test_square_o.py +22 -0
- puzzlekit-0.1.0/tests/test_starbattle.py +24 -0
- puzzlekit-0.1.0/tests/test_str8t.py +22 -0
- puzzlekit-0.1.0/tests/test_sudoku.py +22 -0
- puzzlekit-0.1.0/tests/test_suguru.py +23 -0
- puzzlekit-0.1.0/tests/test_sumo_sudoku.py +22 -0
- puzzlekit-0.1.0/tests/test_tenner_grid.py +22 -0
- puzzlekit-0.1.0/tests/test_tent.py +24 -0
- puzzlekit-0.1.0/tests/test_terra_x.py +23 -0
- puzzlekit-0.1.0/tests/test_thermometer.py +24 -0
- puzzlekit-0.1.0/tests/test_tile_paint.py +25 -0
- puzzlekit-0.1.0/tests/test_windmill_sudoku.py +22 -0
- puzzlekit-0.1.0/tests/test_yajilin.py +22 -0
puzzlekit-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 SmilingWayne
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
puzzlekit-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: puzzlekit
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A comprehensive logic puzzle solver (60+) based on Google OR-Tools. e.g. Nonogram, Slitherlink, Akari, Yajilin, Hitori and Sudoku-variants.
|
|
5
|
+
Author-email: SmilingWayne <xiaoxiaowayne@gmail.com>
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2025 SmilingWayne
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
Project-URL: Homepage, https://github.com/SmilingWayne/PuzzleSolver
|
|
29
|
+
Project-URL: Repository, https://github.com/SmilingWayne/PuzzleSolver
|
|
30
|
+
Project-URL: Issues, https://github.com/SmilingWayne/PuzzleSolver/issues
|
|
31
|
+
Keywords: puzzle,solver,logic,cp-sat,efficient,python,nonogram,slitherlink,yajilin,hitori,sudoku,akari
|
|
32
|
+
Classifier: Development Status :: 3 - Alpha
|
|
33
|
+
Classifier: Intended Audience :: Developers
|
|
34
|
+
Classifier: Intended Audience :: Science/Research
|
|
35
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
36
|
+
Classifier: Programming Language :: Python :: 3
|
|
37
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
38
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
39
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
40
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
41
|
+
Classifier: Topic :: Games/Entertainment :: Puzzle Games
|
|
42
|
+
Classifier: Operating System :: OS Independent
|
|
43
|
+
Requires-Python: >=3.10
|
|
44
|
+
Description-Content-Type: text/markdown
|
|
45
|
+
License-File: LICENSE
|
|
46
|
+
Requires-Dist: numpy
|
|
47
|
+
Requires-Dist: ortools>=9.6
|
|
48
|
+
Requires-Dist: matplotlib
|
|
49
|
+
Requires-Dist: typeguard
|
|
50
|
+
Dynamic: license-file
|
|
51
|
+
|
|
52
|
+
# Puzzle Kit
|
|
53
|
+
|
|
54
|
+
[](https://github.com/SmilingWayne/PuzzleSolver/blob/main/README.md)
|
|
55
|
+
[](https://github.com/SmilingWayne/PuzzleSolver/blob/main/README.CN.md)
|
|
56
|
+
|
|
57
|
+
This repository provides **60+ useful, efficient, and problem‑specific solvers** for a variety of **logic puzzles**. The underlying solving engines are open‑source tools such as [ortools](https://developers.google.cn/optimization).
|
|
58
|
+
|
|
59
|
+
The repository also includes a structured dataset (32k+ instances) covering 100+ specific and popular puzzle types (like Nonogram, Slitherlink, Akari, Fillomino, Hitori, Kakuro, Kakuro) from [Raetsel's Janko](https://www.janko.at/Raetsel/index.htm) and [puzz.link](https://puzz.link), as detailed in the table below. More data, along with related analytics, will be added over time.
|
|
60
|
+
|
|
61
|
+
Most of solvers implemented in this repo are both effective and efficient. They have been tested in 20k+ instances, most of which can be easily solved 0.5 s, even grids with a scale of 20x20. The detailed table of puzzles, datasets and solver performance are shown below.
|
|
62
|
+
|
|
63
|
+
<details>
|
|
64
|
+
<summary><strong>Table of puzzles, datasets and solvers.</strong></summary>
|
|
65
|
+
|
|
66
|
+
> `S&V` means "**S**olved and **V**erified",
|
|
67
|
+
>
|
|
68
|
+
> `C?` indicates whether the crawler of the puzzle is provided.
|
|
69
|
+
>
|
|
70
|
+
> `Problem` and `Solution` means the number of instances and its answers in dataset respectively.
|
|
71
|
+
>
|
|
72
|
+
> `Max Size` shows the maximum scale of existing puzzles.
|
|
73
|
+
>
|
|
74
|
+
> Performance of solvers (solving time, number of constrs and variables would be added in the future). Some solvers are not refactored, thus they are marked as unsolved and unverified.
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
| No. | Puzzle Name | Problems | Solutions | Max Size | Solver? | Avg Time | Max Time | Correct |
|
|
78
|
+
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
|
79
|
+
| 1 | [ABCEndView](./assets/data/ABCEndView) | 607 | 607 | 8x8 | ✅ | 0.015s | 0.061s | 592 |
|
|
80
|
+
| 2 | [Akari](./assets/data/Akari) | 970 | 970 | 100x100 | ✅ | 0.014s | 0.478s | 970 |
|
|
81
|
+
| 3 | [BalanceLoop](./assets/data/BalanceLoop) | 70 | 70 | 17x17 | ✅ | 0.062s | 0.243s | 70 |
|
|
82
|
+
| 4 | [Battleship](./assets/data/Battleship) | 0 | 0 | - | ❌ | - | - | - |
|
|
83
|
+
| 5 | [Binairo](./assets/data/Binairo) | 380 | 380 | 14x14 | ✅ | 0.007s | 0.015s | 380 |
|
|
84
|
+
| 6 | [Bosanowa](./assets/data/Bosanowa) | 38 | 38 | 11x16 | ✅ | 0.016s | 0.214s | 38 |
|
|
85
|
+
| 7 | [Bricks](./assets/data/Bricks) | 210 | 210 | 8x8 | ❌ | - | - | - |
|
|
86
|
+
| 8 | [Buraitoraito](./assets/data/Buraitoraito) | 101 | 100 | 15x15 | ✅ | 0.007s | 0.123s | 100 |
|
|
87
|
+
| 9 | [Burokku](./assets/data/Burokku) | 270 | 270 | 10x10 | ❌ | - | - | - |
|
|
88
|
+
| 10 | [ButterflySudoku](./assets/data/ButterflySudoku) | 77 | 77 | 12x12 | ✅ | 0.008s | 0.011s | 77 |
|
|
89
|
+
| 11 | [Clueless1Sudoku](./assets/data/Clueless1Sudoku) | 29 | 29 | 27x27 | ✅ | 0.029s | 0.041s | 29 |
|
|
90
|
+
| 12 | [Clueless2Sudoku](./assets/data/Clueless2Sudoku) | 40 | 40 | 27x27 | ✅ | 0.033s | 0.082s | 40 |
|
|
91
|
+
| 13 | [ConsecutiveSudoku](./assets/data/ConsecutiveSudoku) | 211 | 211 | 9x9 | ❌ | - | - | - |
|
|
92
|
+
| 14 | [Corral](./assets/data/Corral) | 419 | 419 | 25x25 | ❌ | - | - | - |
|
|
93
|
+
| 15 | [CountryRoad](./assets/data/CountryRoad) | 270 | 270 | 15x15 | ✅ | 0.026s | 0.084s | 270 |
|
|
94
|
+
| 16 | [Creek](./assets/data/Creek) | 440 | 440 | 40x50 | ❌ | - | - | - |
|
|
95
|
+
| 17 | [CurvingRoad](./assets/data/CurvingRoad) | 190 | 190 | 14x14 | ❌ | - | - | - |
|
|
96
|
+
| 18 | [Detour](./assets/data/Detour) | 80 | 80 | 13x12 | ✅ | 0.024s | 0.357s | 80 |
|
|
97
|
+
| 19 | [DiffNeighbors](./assets/data/DiffNeighbors) | 140 | 140 | 15x15 | ❌ | - | - | - |
|
|
98
|
+
| 20 | [Dominos](./assets/data/Dominos) | 580 | 579 | 10x11 | ✅ | 0.004s | 0.009s | 579 |
|
|
99
|
+
| 21 | [DotchiLoop](./assets/data/DotchiLoop) | 60 | 60 | 17x17 | ❌ | - | - | - |
|
|
100
|
+
| 22 | [DoubleBack](./assets/data/DoubleBack) | 100 | 100 | 26x26 | ✅ | 0.024s | 0.262s | 100 |
|
|
101
|
+
| 23 | [EntryExit](./assets/data/EntryExit) | 170 | 170 | 16x16 | ✅ | 0.036s | 0.068s | 170 |
|
|
102
|
+
| 24 | [Eulero](./assets/data/Eulero) | 290 | 290 | 5x5 | ✅ | 0.004s | 0.011s | 290 |
|
|
103
|
+
| 25 | [EvenOddSudoku](./assets/data/EvenOddSudoku) | 129 | 129 | 9x9 | ✅ | 0.004s | 0.006s | 129 |
|
|
104
|
+
| 26 | [Fillomino](./assets/data/Fillomino) | 840 | 840 | 50x64 | ❌ | - | - | - |
|
|
105
|
+
| 27 | [Fobidoshi](./assets/data/Fobidoshi) | 250 | 250 | 12x12 | ✅ | 0.052s | 0.128s | 250 |
|
|
106
|
+
| 28 | [Foseruzu](./assets/data/Foseruzu) | 310 | 310 | 30x45 | ❌ | - | - | - |
|
|
107
|
+
| 29 | [Fuzuli](./assets/data/Fuzuli) | 160 | 160 | 8x8 | ✅ | 0.010s | 0.017s | 160 |
|
|
108
|
+
| 30 | [Gappy](./assets/data/Gappy) | 429 | 427 | 18x18 | ✅ | 0.018s | 0.059s | 427 |
|
|
109
|
+
| 31 | [Gattai8Sudoku](./assets/data/Gattai8Sudoku) | 120 | 120 | 21x33 | ✅ | 0.020s | 0.028s | 120 |
|
|
110
|
+
| 32 | [GokigenNaname](./assets/data/GokigenNaname) | 780 | 780 | 24x36 | ❌ | - | - | - |
|
|
111
|
+
| 33 | [GrandTour](./assets/data/GrandTour) | 350 | 350 | 15x15 | ✅ | 0.018s | 0.059s | 350 |
|
|
112
|
+
| 34 | [Hakoiri](./assets/data/Hakoiri) | 140 | 140 | 12x12 | ❌ | - | - | - |
|
|
113
|
+
| 35 | [Hakyuu](./assets/data/Hakyuu) | 480 | 480 | 30x45 | ✅ | 0.042s | 0.935s | 480 |
|
|
114
|
+
| 36 | [Heyawake](./assets/data/Heyawake) | 787 | 787 | 31x45 | ✅ | 0.470s | 22.841s | 786 |
|
|
115
|
+
| 37 | [Hidoku](./assets/data/Hidoku) | 510 | 510 | 10x10 | ❌ | - | - | - |
|
|
116
|
+
| 38 | [Hitori](./assets/data/Hitori) | 941 | 941 | 25x25 | ✅ | 0.210s | 2.084s | 940 |
|
|
117
|
+
| 39 | [JigsawSudoku](./assets/data/JigsawSudoku) | 680 | 680 | 9x9 | ✅ | 0.003s | 0.008s | 665 |
|
|
118
|
+
| 40 | [Juosan](./assets/data/Juosan) | 80 | 80 | 30x45 | ❌ | - | - | - |
|
|
119
|
+
| 41 | [Kakkuru](./assets/data/Kakkuru) | 400 | 400 | 9x9 | ❌ | - | - | - |
|
|
120
|
+
| 42 | [Kakurasu](./assets/data/Kakurasu) | 280 | 280 | 11x11 | ✅ | 0.003s | 0.016s | 280 |
|
|
121
|
+
| 43 | [Kakuro](./assets/data/Kakuro) | 999 | 999 | 31x46 | ✅ | 0.011s | 0.189s | 999 |
|
|
122
|
+
| 44 | [KillerSudoku](./assets/data/KillerSudoku) | 810 | 810 | 9x9 | ✅ | 0.006s | 0.091s | 586 |
|
|
123
|
+
| 45 | [Kuromasu](./assets/data/Kuromasu) | 560 | 560 | 31x45 | ❌ | - | - | - |
|
|
124
|
+
| 46 | [Kuroshuto](./assets/data/Kuroshuto) | 210 | 210 | 14x14 | ✅ | 0.146s | 0.892s | 210 |
|
|
125
|
+
| 47 | [LITS](./assets/data/LITS) | 419 | 419 | 40x57 | ❌ | - | - | - |
|
|
126
|
+
| 48 | [Linesweeper](./assets/data/Linesweeper) | 310 | 310 | 16x16 | ✅ | 0.017s | 0.046s | 310 |
|
|
127
|
+
| 49 | [Magnetic](./assets/data/Magnetic) | 439 | 439 | 12x12 | ✅ | 0.010s | 0.028s | 439 |
|
|
128
|
+
| 50 | [Makaro](./assets/data/Makaro) | 190 | 190 | 15x15 | ❌ | - | - | - |
|
|
129
|
+
| 51 | [MarginSudoku](./assets/data/MarginSudoku) | 149 | 149 | 9x9 | ❌ | - | - | - |
|
|
130
|
+
| 52 | [Masyu](./assets/data/Masyu) | 828 | 828 | 40x58 | ✅ | 0.065s | 0.777s | 828 |
|
|
131
|
+
| 53 | [Maze-a-pix](./assets/data/Maze-a-pix) | 0 | 0 | - | ❌ | - | - | - |
|
|
132
|
+
| 54 | [Minesweeper](./assets/data/Minesweeper) | 360 | 360 | 14x24 | ✅ | 0.005s | 0.023s | 360 |
|
|
133
|
+
| 55 | [MoonSun](./assets/data/MoonSun) | 200 | 200 | 30x45 | ❌ | - | - | - |
|
|
134
|
+
| 56 | [Mosaic](./assets/data/Mosaic) | 165 | 104 | 118x100 | ✅ | 0.015s | 0.123s | 104 |
|
|
135
|
+
| 57 | [Munraito](./assets/data/Munraito) | 360 | 360 | 12x12 | ✅ | 0.010s | 0.026s | 360 |
|
|
136
|
+
| 58 | [Nanbaboru](./assets/data/Nanbaboru) | 270 | 270 | 9x9 | ❌ | - | - | - |
|
|
137
|
+
| 59 | [Nondango](./assets/data/Nondango) | 110 | 110 | 14x14 | ✅ | 0.004s | 0.009s | 110 |
|
|
138
|
+
| 60 | [Nonogram](./assets/data/Nonogram) | 2338 | 2337 | 30x40 | ✅ | 0.305s | 1.216s | 2337 |
|
|
139
|
+
| 61 | [Norinori](./assets/data/Norinori) | 289 | 289 | 36x54 | ✅ | 0.008s | 0.083s | 288 |
|
|
140
|
+
| 62 | [NumberCross](./assets/data/NumberCross) | 170 | 170 | 8x8 | ❌ | - | - | - |
|
|
141
|
+
| 63 | [NumberLink](./assets/data/NumberLink) | 580 | 580 | 35x48 | ❌ | - | - | - |
|
|
142
|
+
| 64 | [NumberSnake](./assets/data/NumberSnake) | 70 | 70 | 10x10 | ❌ | - | - | - |
|
|
143
|
+
| 65 | [OneToX](./assets/data/OneToX) | 58 | 58 | 10x10 | ✅ | 0.011s | 0.138s | 58 |
|
|
144
|
+
| 66 | [Patchwork](./assets/data/Patchwork) | 211 | 211 | 12x12 | ✅ | 0.020s | 0.032s | 211 |
|
|
145
|
+
| 67 | [Pfeilzahlen](./assets/data/Pfeilzahlen) | 360 | 360 | 10x10 | ✅ | 0.012s | 0.027s | 358 |
|
|
146
|
+
| 68 | [Pills](./assets/data/Pills) | 164 | 163 | 10x10 | ✅ | 0.007s | 0.010s | 163 |
|
|
147
|
+
| 69 | [Polyiamond](./assets/data/Polyiamond) | 0 | 0 | - | ❌ | - | - | - |
|
|
148
|
+
| 70 | [Polyminoes](./assets/data/Polyminoes) | 0 | 0 | - | ❌ | - | - | - |
|
|
149
|
+
| 71 | [RegionalYajilin](./assets/data/RegionalYajilin) | 70 | 70 | 10x18 | ❌ | - | - | - |
|
|
150
|
+
| 72 | [Renban](./assets/data/Renban) | 150 | 150 | 9x9 | ✅ | 0.005s | 0.066s | 150 |
|
|
151
|
+
| 73 | [SamuraiSudoku](./assets/data/SamuraiSudoku) | 272 | 272 | 21x21 | ✅ | 0.011s | 0.021s | 272 |
|
|
152
|
+
| 74 | [Shikaku](./assets/data/Shikaku) | 500 | 500 | 31x45 | ✅ | 0.010s | 0.056s | 497 |
|
|
153
|
+
| 75 | [Shimaguni](./assets/data/Shimaguni) | 266 | 266 | 30x45 | ❌ | - | - | - |
|
|
154
|
+
| 76 | [Shingoki](./assets/data/Shingoki) | 100 | 100 | 21x21 | ❌ | - | - | - |
|
|
155
|
+
| 77 | [Shirokuro](./assets/data/Shirokuro) | 110 | 110 | 17x17 | ❌ | - | - | - |
|
|
156
|
+
| 78 | [ShogunSudoku](./assets/data/ShogunSudoku) | 90 | 90 | 21x45 | ✅ | 0.030s | 0.049s | 90 |
|
|
157
|
+
| 79 | [Shugaku](./assets/data/Shugaku) | 130 | 130 | 30x45 | ❌ | - | - | - |
|
|
158
|
+
| 80 | [SimpleLoop](./assets/data/SimpleLoop) | 70 | 70 | 17x18 | ✅ | 0.020s | 0.053s | 70 |
|
|
159
|
+
| 81 | [Skyscraper](./assets/data/Skyscraper) | 470 | 470 | 8x8 | ❌ | - | - | - |
|
|
160
|
+
| 82 | [SkyscraperSudoku](./assets/data/SkyscraperSudoku) | 50 | 50 | 9x9 | ❌ | - | - | - |
|
|
161
|
+
| 83 | [Slitherlink](./assets/data/Slitherlink) | 1176 | 1153 | 60x60 | ✅ | 0.067s | 1.797s | 1149 |
|
|
162
|
+
| 84 | [Snake](./assets/data/Snake) | 230 | 230 | 12x12 | ❌ | - | - | - |
|
|
163
|
+
| 85 | [SoheiSudoku](./assets/data/SoheiSudoku) | 120 | 120 | 21x21 | ✅ | 0.010s | 0.021s | 120 |
|
|
164
|
+
| 86 | [SquareO](./assets/data/SquareO) | 120 | 80 | 15x15 | ✅ | 0.004s | 0.022s | 80 |
|
|
165
|
+
| 87 | [Starbattle](./assets/data/Starbattle) | 307 | 307 | 15x15 | ✅ | 0.009s | 0.025s | 307 |
|
|
166
|
+
| 88 | [Sternenhimmel](./assets/data/Sternenhimmel) | 29 | 29 | 17x17 | ❌ | - | - | - |
|
|
167
|
+
| 89 | [Str8t](./assets/data/Str8t) | 560 | 560 | 9x9 | ❌ | - | - | - |
|
|
168
|
+
| 90 | [Sudoku](./assets/data/Sudoku) | 125 | 125 | 16x16 | ✅ | 0.010s | 0.020s | 125 |
|
|
169
|
+
| 91 | [Suguru](./assets/data/Suguru) | 200 | 200 | 10x10 | ✅ | 0.008s | 0.015s | 200 |
|
|
170
|
+
| 92 | [SumoSudoku](./assets/data/SumoSudoku) | 110 | 110 | 33x33 | ✅ | 0.032s | 0.048s | 110 |
|
|
171
|
+
| 93 | [Tatamibari](./assets/data/Tatamibari) | 150 | 150 | 14x14 | ❌ | - | - | - |
|
|
172
|
+
| 94 | [TennerGrid](./assets/data/TennerGrid) | 375 | 374 | 6x10 | ✅ | 0.007s | 0.012s | 374 |
|
|
173
|
+
| 95 | [Tent](./assets/data/Tent) | 706 | 706 | 30x30 | ✅ | 0.006s | 0.026s | 706 |
|
|
174
|
+
| 96 | [TerraX](./assets/data/TerraX) | 80 | 80 | 17x17 | ✅ | 0.009s | 0.018s | 80 |
|
|
175
|
+
| 97 | [Thermometer](./assets/data/Thermometer) | 250 | 250 | 10x10 | ✅ | 0.004s | 0.007s | 250 |
|
|
176
|
+
| 98 | [TilePaint](./assets/data/TilePaint) | 377 | 377 | 16x16 | ✅ | 0.004s | 0.069s | 377 |
|
|
177
|
+
| 99 | [Trinairo](./assets/data/Trinairo) | 60 | 60 | 12x12 | ❌ | - | - | - |
|
|
178
|
+
| 100 | [WindmillSudoku](./assets/data/WindmillSudoku) | 150 | 150 | 21x21 | ✅ | 0.012s | 0.019s | 150 |
|
|
179
|
+
| 101 | [Yajilin](./assets/data/Yajilin) | 610 | 610 | 39x57 | ✅ | 0.053s | 0.542s | 610 |
|
|
180
|
+
| 102 | [YinYang](./assets/data/YinYang) | 170 | 170 | 14x14 | ❌ | - | - | - |
|
|
181
|
+
| 103 | [Yonmasu](./assets/data/Yonmasu) | 120 | 120 | 10x10 | ❌ | - | - | - |
|
|
182
|
+
| 104 | [fivecells](./assets/data/fivecells) | 0 | 0 | - | ❌ | - | - | - |
|
|
183
|
+
| | **Total** | **32330** | **32199** | - | - | - | - | - |
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
</details>
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
<details>
|
|
190
|
+
<summary><strong>Gallery of some puzzles (not complete!)</strong></summary>
|
|
191
|
+
|
|
192
|
+

|
|
193
|
+
|
|
194
|
+

|
|
195
|
+
|
|
196
|
+
</details>
|
|
197
|
+
|
|
198
|
+
Unlike other solvers that rely on logical/deductive methods, the solvers here are primarily based on **C**onstraint **P**rogramming. While I greatly admire those who can spot purely logical solutions, this project is **not** intended to replace human reasoning with automated solving: **it’s just for fun**.
|
|
199
|
+
|
|
200
|
+
Some details are greatly inspired by similar yet more sophisticated repositories like [puzzle_solver](https://github.com/Ar-Kareem/puzzle_solver) for 90+puzzles by Ar-Kareem and [Puzzles-Solver](https://github.com/newtomsoft/Puzzles-Solver) in action by newtomsoft.
|
|
201
|
+
|
|
202
|
+
## Usage
|
|
203
|
+
|
|
204
|
+
Dependencies: Python >= 3.10, e.g.,
|
|
205
|
+
|
|
206
|
+
```shell
|
|
207
|
+
conda create -n py310 python=3.10.14
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
install the solvers via pip:
|
|
211
|
+
|
|
212
|
+
```shell
|
|
213
|
+
pip install puzzlekit
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
Then a quick tour:
|
|
217
|
+
|
|
218
|
+
```python
|
|
219
|
+
import puzzlekit
|
|
220
|
+
|
|
221
|
+
data = {
|
|
222
|
+
"num_rows": 20,
|
|
223
|
+
"num_cols": 20,
|
|
224
|
+
"cols": list(map(lambda x: x.split(" "), "2 8\n5 2\n2 4 2\n6 1\n2 2\n2 5\n6 1 6\n3 3 6\n2 1 1 1 3 1\n2 1 1 1\n2 1\n2 1 1 1\n1 1 1 4\n2 1 1 2 2\n2 3 1\n2 1 1 1\n2 1 1 5 1\n3 8 1\n6 6 2\n7".split("\n"))),
|
|
225
|
+
"rows": list(map(lambda x: x.split(" "), "2 2\n1 1 4 4\n1 1 2 3 2\n1 1\n4 2 1 1 2\n4 1 2 2 1\n4 1 1 1\n4 1 2 2 1\n2 1 1 3 1\n1 2 2 2\n1 2 2 1\n2 3 3\n2 4\n3 1 4\n4 1 4\n4 2 4\n4 2 3\n4 1 1\n3 2 2\n13".split("\n"))),
|
|
226
|
+
"grid": list()
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
solver = puzzlekit.solver("nonogram", data)
|
|
230
|
+
result = solver.solve()
|
|
231
|
+
print(result)
|
|
232
|
+
# result.show(auto_close_sec = 10)
|
|
233
|
+
# run this If you wanna see the final result in matplotlib ...
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
## Table of contents
|
|
238
|
+
|
|
239
|
+
1. [Solvers for Logic Puzzles by CS-SAT](./Puzzles/). INTERESTING and brain-burning logic puzzles (at least it's hard for impatient guys like me).
|
|
240
|
+
|
|
241
|
+
2. [Dataset of 100+ puzzles](./assets/data/), One of the key features that distinguishes this repository from related works.
|
|
242
|
+
|
|
243
|
+
- **Motivation**: Many puzzles available online are stored in PDF or image formats, which are not readily usable for automated solving. This repository provides easy-to-use web [crawlers](./Crawlers/) that extract puzzle data and convert it into a structured, machine-readable format.
|
|
244
|
+
- **Usage**: The datasets can serve as benchmarks for evaluating and testing the performance of computer-aided solvers.
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
----
|
|
248
|
+
|
|
249
|
+
## Reference
|
|
250
|
+
|
|
251
|
+
- [ortools Official](https://developers.google.cn/optimization?hl=zh-cn).
|
|
252
|
+
- [Hakank's ORtools tutorials](http://www.hakank.org/google_or_tools/).
|
|
253
|
+
- [PySCIPOpt's tutorials](https://pyscipopt.readthedocs.io/en/latest/tutorials/).
|
|
254
|
+
- Puzzle data source: [Raetsel's Janko](https://www.janko.at/Raetsel/index.htm), [Puzzle](https://www.puzzle-loop.com).
|
|
255
|
+
- Related repos like [puzzle_solver](https://github.com/Ar-Kareem/puzzle_solver) and [Puzzles-Solver](https://github.com/newtomsoft/Puzzles-Solver).
|
|
256
|
+
- [puzz.link](https://puzz.link) and [pzprjs](https://github.com/robx/pzprjs).
|
|
257
|
+
- [Nonogram solver](https://rosettacode.org/wiki/Nonogram_solver#Python).
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
# Puzzle Kit
|
|
2
|
+
|
|
3
|
+
[](https://github.com/SmilingWayne/PuzzleSolver/blob/main/README.md)
|
|
4
|
+
[](https://github.com/SmilingWayne/PuzzleSolver/blob/main/README.CN.md)
|
|
5
|
+
|
|
6
|
+
This repository provides **60+ useful, efficient, and problem‑specific solvers** for a variety of **logic puzzles**. The underlying solving engines are open‑source tools such as [ortools](https://developers.google.cn/optimization).
|
|
7
|
+
|
|
8
|
+
The repository also includes a structured dataset (32k+ instances) covering 100+ specific and popular puzzle types (like Nonogram, Slitherlink, Akari, Fillomino, Hitori, Kakuro, Kakuro) from [Raetsel's Janko](https://www.janko.at/Raetsel/index.htm) and [puzz.link](https://puzz.link), as detailed in the table below. More data, along with related analytics, will be added over time.
|
|
9
|
+
|
|
10
|
+
Most of solvers implemented in this repo are both effective and efficient. They have been tested in 20k+ instances, most of which can be easily solved 0.5 s, even grids with a scale of 20x20. The detailed table of puzzles, datasets and solver performance are shown below.
|
|
11
|
+
|
|
12
|
+
<details>
|
|
13
|
+
<summary><strong>Table of puzzles, datasets and solvers.</strong></summary>
|
|
14
|
+
|
|
15
|
+
> `S&V` means "**S**olved and **V**erified",
|
|
16
|
+
>
|
|
17
|
+
> `C?` indicates whether the crawler of the puzzle is provided.
|
|
18
|
+
>
|
|
19
|
+
> `Problem` and `Solution` means the number of instances and its answers in dataset respectively.
|
|
20
|
+
>
|
|
21
|
+
> `Max Size` shows the maximum scale of existing puzzles.
|
|
22
|
+
>
|
|
23
|
+
> Performance of solvers (solving time, number of constrs and variables would be added in the future). Some solvers are not refactored, thus they are marked as unsolved and unverified.
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
| No. | Puzzle Name | Problems | Solutions | Max Size | Solver? | Avg Time | Max Time | Correct |
|
|
27
|
+
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
|
28
|
+
| 1 | [ABCEndView](./assets/data/ABCEndView) | 607 | 607 | 8x8 | ✅ | 0.015s | 0.061s | 592 |
|
|
29
|
+
| 2 | [Akari](./assets/data/Akari) | 970 | 970 | 100x100 | ✅ | 0.014s | 0.478s | 970 |
|
|
30
|
+
| 3 | [BalanceLoop](./assets/data/BalanceLoop) | 70 | 70 | 17x17 | ✅ | 0.062s | 0.243s | 70 |
|
|
31
|
+
| 4 | [Battleship](./assets/data/Battleship) | 0 | 0 | - | ❌ | - | - | - |
|
|
32
|
+
| 5 | [Binairo](./assets/data/Binairo) | 380 | 380 | 14x14 | ✅ | 0.007s | 0.015s | 380 |
|
|
33
|
+
| 6 | [Bosanowa](./assets/data/Bosanowa) | 38 | 38 | 11x16 | ✅ | 0.016s | 0.214s | 38 |
|
|
34
|
+
| 7 | [Bricks](./assets/data/Bricks) | 210 | 210 | 8x8 | ❌ | - | - | - |
|
|
35
|
+
| 8 | [Buraitoraito](./assets/data/Buraitoraito) | 101 | 100 | 15x15 | ✅ | 0.007s | 0.123s | 100 |
|
|
36
|
+
| 9 | [Burokku](./assets/data/Burokku) | 270 | 270 | 10x10 | ❌ | - | - | - |
|
|
37
|
+
| 10 | [ButterflySudoku](./assets/data/ButterflySudoku) | 77 | 77 | 12x12 | ✅ | 0.008s | 0.011s | 77 |
|
|
38
|
+
| 11 | [Clueless1Sudoku](./assets/data/Clueless1Sudoku) | 29 | 29 | 27x27 | ✅ | 0.029s | 0.041s | 29 |
|
|
39
|
+
| 12 | [Clueless2Sudoku](./assets/data/Clueless2Sudoku) | 40 | 40 | 27x27 | ✅ | 0.033s | 0.082s | 40 |
|
|
40
|
+
| 13 | [ConsecutiveSudoku](./assets/data/ConsecutiveSudoku) | 211 | 211 | 9x9 | ❌ | - | - | - |
|
|
41
|
+
| 14 | [Corral](./assets/data/Corral) | 419 | 419 | 25x25 | ❌ | - | - | - |
|
|
42
|
+
| 15 | [CountryRoad](./assets/data/CountryRoad) | 270 | 270 | 15x15 | ✅ | 0.026s | 0.084s | 270 |
|
|
43
|
+
| 16 | [Creek](./assets/data/Creek) | 440 | 440 | 40x50 | ❌ | - | - | - |
|
|
44
|
+
| 17 | [CurvingRoad](./assets/data/CurvingRoad) | 190 | 190 | 14x14 | ❌ | - | - | - |
|
|
45
|
+
| 18 | [Detour](./assets/data/Detour) | 80 | 80 | 13x12 | ✅ | 0.024s | 0.357s | 80 |
|
|
46
|
+
| 19 | [DiffNeighbors](./assets/data/DiffNeighbors) | 140 | 140 | 15x15 | ❌ | - | - | - |
|
|
47
|
+
| 20 | [Dominos](./assets/data/Dominos) | 580 | 579 | 10x11 | ✅ | 0.004s | 0.009s | 579 |
|
|
48
|
+
| 21 | [DotchiLoop](./assets/data/DotchiLoop) | 60 | 60 | 17x17 | ❌ | - | - | - |
|
|
49
|
+
| 22 | [DoubleBack](./assets/data/DoubleBack) | 100 | 100 | 26x26 | ✅ | 0.024s | 0.262s | 100 |
|
|
50
|
+
| 23 | [EntryExit](./assets/data/EntryExit) | 170 | 170 | 16x16 | ✅ | 0.036s | 0.068s | 170 |
|
|
51
|
+
| 24 | [Eulero](./assets/data/Eulero) | 290 | 290 | 5x5 | ✅ | 0.004s | 0.011s | 290 |
|
|
52
|
+
| 25 | [EvenOddSudoku](./assets/data/EvenOddSudoku) | 129 | 129 | 9x9 | ✅ | 0.004s | 0.006s | 129 |
|
|
53
|
+
| 26 | [Fillomino](./assets/data/Fillomino) | 840 | 840 | 50x64 | ❌ | - | - | - |
|
|
54
|
+
| 27 | [Fobidoshi](./assets/data/Fobidoshi) | 250 | 250 | 12x12 | ✅ | 0.052s | 0.128s | 250 |
|
|
55
|
+
| 28 | [Foseruzu](./assets/data/Foseruzu) | 310 | 310 | 30x45 | ❌ | - | - | - |
|
|
56
|
+
| 29 | [Fuzuli](./assets/data/Fuzuli) | 160 | 160 | 8x8 | ✅ | 0.010s | 0.017s | 160 |
|
|
57
|
+
| 30 | [Gappy](./assets/data/Gappy) | 429 | 427 | 18x18 | ✅ | 0.018s | 0.059s | 427 |
|
|
58
|
+
| 31 | [Gattai8Sudoku](./assets/data/Gattai8Sudoku) | 120 | 120 | 21x33 | ✅ | 0.020s | 0.028s | 120 |
|
|
59
|
+
| 32 | [GokigenNaname](./assets/data/GokigenNaname) | 780 | 780 | 24x36 | ❌ | - | - | - |
|
|
60
|
+
| 33 | [GrandTour](./assets/data/GrandTour) | 350 | 350 | 15x15 | ✅ | 0.018s | 0.059s | 350 |
|
|
61
|
+
| 34 | [Hakoiri](./assets/data/Hakoiri) | 140 | 140 | 12x12 | ❌ | - | - | - |
|
|
62
|
+
| 35 | [Hakyuu](./assets/data/Hakyuu) | 480 | 480 | 30x45 | ✅ | 0.042s | 0.935s | 480 |
|
|
63
|
+
| 36 | [Heyawake](./assets/data/Heyawake) | 787 | 787 | 31x45 | ✅ | 0.470s | 22.841s | 786 |
|
|
64
|
+
| 37 | [Hidoku](./assets/data/Hidoku) | 510 | 510 | 10x10 | ❌ | - | - | - |
|
|
65
|
+
| 38 | [Hitori](./assets/data/Hitori) | 941 | 941 | 25x25 | ✅ | 0.210s | 2.084s | 940 |
|
|
66
|
+
| 39 | [JigsawSudoku](./assets/data/JigsawSudoku) | 680 | 680 | 9x9 | ✅ | 0.003s | 0.008s | 665 |
|
|
67
|
+
| 40 | [Juosan](./assets/data/Juosan) | 80 | 80 | 30x45 | ❌ | - | - | - |
|
|
68
|
+
| 41 | [Kakkuru](./assets/data/Kakkuru) | 400 | 400 | 9x9 | ❌ | - | - | - |
|
|
69
|
+
| 42 | [Kakurasu](./assets/data/Kakurasu) | 280 | 280 | 11x11 | ✅ | 0.003s | 0.016s | 280 |
|
|
70
|
+
| 43 | [Kakuro](./assets/data/Kakuro) | 999 | 999 | 31x46 | ✅ | 0.011s | 0.189s | 999 |
|
|
71
|
+
| 44 | [KillerSudoku](./assets/data/KillerSudoku) | 810 | 810 | 9x9 | ✅ | 0.006s | 0.091s | 586 |
|
|
72
|
+
| 45 | [Kuromasu](./assets/data/Kuromasu) | 560 | 560 | 31x45 | ❌ | - | - | - |
|
|
73
|
+
| 46 | [Kuroshuto](./assets/data/Kuroshuto) | 210 | 210 | 14x14 | ✅ | 0.146s | 0.892s | 210 |
|
|
74
|
+
| 47 | [LITS](./assets/data/LITS) | 419 | 419 | 40x57 | ❌ | - | - | - |
|
|
75
|
+
| 48 | [Linesweeper](./assets/data/Linesweeper) | 310 | 310 | 16x16 | ✅ | 0.017s | 0.046s | 310 |
|
|
76
|
+
| 49 | [Magnetic](./assets/data/Magnetic) | 439 | 439 | 12x12 | ✅ | 0.010s | 0.028s | 439 |
|
|
77
|
+
| 50 | [Makaro](./assets/data/Makaro) | 190 | 190 | 15x15 | ❌ | - | - | - |
|
|
78
|
+
| 51 | [MarginSudoku](./assets/data/MarginSudoku) | 149 | 149 | 9x9 | ❌ | - | - | - |
|
|
79
|
+
| 52 | [Masyu](./assets/data/Masyu) | 828 | 828 | 40x58 | ✅ | 0.065s | 0.777s | 828 |
|
|
80
|
+
| 53 | [Maze-a-pix](./assets/data/Maze-a-pix) | 0 | 0 | - | ❌ | - | - | - |
|
|
81
|
+
| 54 | [Minesweeper](./assets/data/Minesweeper) | 360 | 360 | 14x24 | ✅ | 0.005s | 0.023s | 360 |
|
|
82
|
+
| 55 | [MoonSun](./assets/data/MoonSun) | 200 | 200 | 30x45 | ❌ | - | - | - |
|
|
83
|
+
| 56 | [Mosaic](./assets/data/Mosaic) | 165 | 104 | 118x100 | ✅ | 0.015s | 0.123s | 104 |
|
|
84
|
+
| 57 | [Munraito](./assets/data/Munraito) | 360 | 360 | 12x12 | ✅ | 0.010s | 0.026s | 360 |
|
|
85
|
+
| 58 | [Nanbaboru](./assets/data/Nanbaboru) | 270 | 270 | 9x9 | ❌ | - | - | - |
|
|
86
|
+
| 59 | [Nondango](./assets/data/Nondango) | 110 | 110 | 14x14 | ✅ | 0.004s | 0.009s | 110 |
|
|
87
|
+
| 60 | [Nonogram](./assets/data/Nonogram) | 2338 | 2337 | 30x40 | ✅ | 0.305s | 1.216s | 2337 |
|
|
88
|
+
| 61 | [Norinori](./assets/data/Norinori) | 289 | 289 | 36x54 | ✅ | 0.008s | 0.083s | 288 |
|
|
89
|
+
| 62 | [NumberCross](./assets/data/NumberCross) | 170 | 170 | 8x8 | ❌ | - | - | - |
|
|
90
|
+
| 63 | [NumberLink](./assets/data/NumberLink) | 580 | 580 | 35x48 | ❌ | - | - | - |
|
|
91
|
+
| 64 | [NumberSnake](./assets/data/NumberSnake) | 70 | 70 | 10x10 | ❌ | - | - | - |
|
|
92
|
+
| 65 | [OneToX](./assets/data/OneToX) | 58 | 58 | 10x10 | ✅ | 0.011s | 0.138s | 58 |
|
|
93
|
+
| 66 | [Patchwork](./assets/data/Patchwork) | 211 | 211 | 12x12 | ✅ | 0.020s | 0.032s | 211 |
|
|
94
|
+
| 67 | [Pfeilzahlen](./assets/data/Pfeilzahlen) | 360 | 360 | 10x10 | ✅ | 0.012s | 0.027s | 358 |
|
|
95
|
+
| 68 | [Pills](./assets/data/Pills) | 164 | 163 | 10x10 | ✅ | 0.007s | 0.010s | 163 |
|
|
96
|
+
| 69 | [Polyiamond](./assets/data/Polyiamond) | 0 | 0 | - | ❌ | - | - | - |
|
|
97
|
+
| 70 | [Polyminoes](./assets/data/Polyminoes) | 0 | 0 | - | ❌ | - | - | - |
|
|
98
|
+
| 71 | [RegionalYajilin](./assets/data/RegionalYajilin) | 70 | 70 | 10x18 | ❌ | - | - | - |
|
|
99
|
+
| 72 | [Renban](./assets/data/Renban) | 150 | 150 | 9x9 | ✅ | 0.005s | 0.066s | 150 |
|
|
100
|
+
| 73 | [SamuraiSudoku](./assets/data/SamuraiSudoku) | 272 | 272 | 21x21 | ✅ | 0.011s | 0.021s | 272 |
|
|
101
|
+
| 74 | [Shikaku](./assets/data/Shikaku) | 500 | 500 | 31x45 | ✅ | 0.010s | 0.056s | 497 |
|
|
102
|
+
| 75 | [Shimaguni](./assets/data/Shimaguni) | 266 | 266 | 30x45 | ❌ | - | - | - |
|
|
103
|
+
| 76 | [Shingoki](./assets/data/Shingoki) | 100 | 100 | 21x21 | ❌ | - | - | - |
|
|
104
|
+
| 77 | [Shirokuro](./assets/data/Shirokuro) | 110 | 110 | 17x17 | ❌ | - | - | - |
|
|
105
|
+
| 78 | [ShogunSudoku](./assets/data/ShogunSudoku) | 90 | 90 | 21x45 | ✅ | 0.030s | 0.049s | 90 |
|
|
106
|
+
| 79 | [Shugaku](./assets/data/Shugaku) | 130 | 130 | 30x45 | ❌ | - | - | - |
|
|
107
|
+
| 80 | [SimpleLoop](./assets/data/SimpleLoop) | 70 | 70 | 17x18 | ✅ | 0.020s | 0.053s | 70 |
|
|
108
|
+
| 81 | [Skyscraper](./assets/data/Skyscraper) | 470 | 470 | 8x8 | ❌ | - | - | - |
|
|
109
|
+
| 82 | [SkyscraperSudoku](./assets/data/SkyscraperSudoku) | 50 | 50 | 9x9 | ❌ | - | - | - |
|
|
110
|
+
| 83 | [Slitherlink](./assets/data/Slitherlink) | 1176 | 1153 | 60x60 | ✅ | 0.067s | 1.797s | 1149 |
|
|
111
|
+
| 84 | [Snake](./assets/data/Snake) | 230 | 230 | 12x12 | ❌ | - | - | - |
|
|
112
|
+
| 85 | [SoheiSudoku](./assets/data/SoheiSudoku) | 120 | 120 | 21x21 | ✅ | 0.010s | 0.021s | 120 |
|
|
113
|
+
| 86 | [SquareO](./assets/data/SquareO) | 120 | 80 | 15x15 | ✅ | 0.004s | 0.022s | 80 |
|
|
114
|
+
| 87 | [Starbattle](./assets/data/Starbattle) | 307 | 307 | 15x15 | ✅ | 0.009s | 0.025s | 307 |
|
|
115
|
+
| 88 | [Sternenhimmel](./assets/data/Sternenhimmel) | 29 | 29 | 17x17 | ❌ | - | - | - |
|
|
116
|
+
| 89 | [Str8t](./assets/data/Str8t) | 560 | 560 | 9x9 | ❌ | - | - | - |
|
|
117
|
+
| 90 | [Sudoku](./assets/data/Sudoku) | 125 | 125 | 16x16 | ✅ | 0.010s | 0.020s | 125 |
|
|
118
|
+
| 91 | [Suguru](./assets/data/Suguru) | 200 | 200 | 10x10 | ✅ | 0.008s | 0.015s | 200 |
|
|
119
|
+
| 92 | [SumoSudoku](./assets/data/SumoSudoku) | 110 | 110 | 33x33 | ✅ | 0.032s | 0.048s | 110 |
|
|
120
|
+
| 93 | [Tatamibari](./assets/data/Tatamibari) | 150 | 150 | 14x14 | ❌ | - | - | - |
|
|
121
|
+
| 94 | [TennerGrid](./assets/data/TennerGrid) | 375 | 374 | 6x10 | ✅ | 0.007s | 0.012s | 374 |
|
|
122
|
+
| 95 | [Tent](./assets/data/Tent) | 706 | 706 | 30x30 | ✅ | 0.006s | 0.026s | 706 |
|
|
123
|
+
| 96 | [TerraX](./assets/data/TerraX) | 80 | 80 | 17x17 | ✅ | 0.009s | 0.018s | 80 |
|
|
124
|
+
| 97 | [Thermometer](./assets/data/Thermometer) | 250 | 250 | 10x10 | ✅ | 0.004s | 0.007s | 250 |
|
|
125
|
+
| 98 | [TilePaint](./assets/data/TilePaint) | 377 | 377 | 16x16 | ✅ | 0.004s | 0.069s | 377 |
|
|
126
|
+
| 99 | [Trinairo](./assets/data/Trinairo) | 60 | 60 | 12x12 | ❌ | - | - | - |
|
|
127
|
+
| 100 | [WindmillSudoku](./assets/data/WindmillSudoku) | 150 | 150 | 21x21 | ✅ | 0.012s | 0.019s | 150 |
|
|
128
|
+
| 101 | [Yajilin](./assets/data/Yajilin) | 610 | 610 | 39x57 | ✅ | 0.053s | 0.542s | 610 |
|
|
129
|
+
| 102 | [YinYang](./assets/data/YinYang) | 170 | 170 | 14x14 | ❌ | - | - | - |
|
|
130
|
+
| 103 | [Yonmasu](./assets/data/Yonmasu) | 120 | 120 | 10x10 | ❌ | - | - | - |
|
|
131
|
+
| 104 | [fivecells](./assets/data/fivecells) | 0 | 0 | - | ❌ | - | - | - |
|
|
132
|
+
| | **Total** | **32330** | **32199** | - | - | - | - | - |
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
</details>
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
<details>
|
|
139
|
+
<summary><strong>Gallery of some puzzles (not complete!)</strong></summary>
|
|
140
|
+
|
|
141
|
+

|
|
142
|
+
|
|
143
|
+

|
|
144
|
+
|
|
145
|
+
</details>
|
|
146
|
+
|
|
147
|
+
Unlike other solvers that rely on logical/deductive methods, the solvers here are primarily based on **C**onstraint **P**rogramming. While I greatly admire those who can spot purely logical solutions, this project is **not** intended to replace human reasoning with automated solving: **it’s just for fun**.
|
|
148
|
+
|
|
149
|
+
Some details are greatly inspired by similar yet more sophisticated repositories like [puzzle_solver](https://github.com/Ar-Kareem/puzzle_solver) for 90+puzzles by Ar-Kareem and [Puzzles-Solver](https://github.com/newtomsoft/Puzzles-Solver) in action by newtomsoft.
|
|
150
|
+
|
|
151
|
+
## Usage
|
|
152
|
+
|
|
153
|
+
Dependencies: Python >= 3.10, e.g.,
|
|
154
|
+
|
|
155
|
+
```shell
|
|
156
|
+
conda create -n py310 python=3.10.14
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
install the solvers via pip:
|
|
160
|
+
|
|
161
|
+
```shell
|
|
162
|
+
pip install puzzlekit
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
Then a quick tour:
|
|
166
|
+
|
|
167
|
+
```python
|
|
168
|
+
import puzzlekit
|
|
169
|
+
|
|
170
|
+
data = {
|
|
171
|
+
"num_rows": 20,
|
|
172
|
+
"num_cols": 20,
|
|
173
|
+
"cols": list(map(lambda x: x.split(" "), "2 8\n5 2\n2 4 2\n6 1\n2 2\n2 5\n6 1 6\n3 3 6\n2 1 1 1 3 1\n2 1 1 1\n2 1\n2 1 1 1\n1 1 1 4\n2 1 1 2 2\n2 3 1\n2 1 1 1\n2 1 1 5 1\n3 8 1\n6 6 2\n7".split("\n"))),
|
|
174
|
+
"rows": list(map(lambda x: x.split(" "), "2 2\n1 1 4 4\n1 1 2 3 2\n1 1\n4 2 1 1 2\n4 1 2 2 1\n4 1 1 1\n4 1 2 2 1\n2 1 1 3 1\n1 2 2 2\n1 2 2 1\n2 3 3\n2 4\n3 1 4\n4 1 4\n4 2 4\n4 2 3\n4 1 1\n3 2 2\n13".split("\n"))),
|
|
175
|
+
"grid": list()
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
solver = puzzlekit.solver("nonogram", data)
|
|
179
|
+
result = solver.solve()
|
|
180
|
+
print(result)
|
|
181
|
+
# result.show(auto_close_sec = 10)
|
|
182
|
+
# run this If you wanna see the final result in matplotlib ...
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
## Table of contents
|
|
187
|
+
|
|
188
|
+
1. [Solvers for Logic Puzzles by CS-SAT](./Puzzles/). INTERESTING and brain-burning logic puzzles (at least it's hard for impatient guys like me).
|
|
189
|
+
|
|
190
|
+
2. [Dataset of 100+ puzzles](./assets/data/), One of the key features that distinguishes this repository from related works.
|
|
191
|
+
|
|
192
|
+
- **Motivation**: Many puzzles available online are stored in PDF or image formats, which are not readily usable for automated solving. This repository provides easy-to-use web [crawlers](./Crawlers/) that extract puzzle data and convert it into a structured, machine-readable format.
|
|
193
|
+
- **Usage**: The datasets can serve as benchmarks for evaluating and testing the performance of computer-aided solvers.
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
----
|
|
197
|
+
|
|
198
|
+
## Reference
|
|
199
|
+
|
|
200
|
+
- [ortools Official](https://developers.google.cn/optimization?hl=zh-cn).
|
|
201
|
+
- [Hakank's ORtools tutorials](http://www.hakank.org/google_or_tools/).
|
|
202
|
+
- [PySCIPOpt's tutorials](https://pyscipopt.readthedocs.io/en/latest/tutorials/).
|
|
203
|
+
- Puzzle data source: [Raetsel's Janko](https://www.janko.at/Raetsel/index.htm), [Puzzle](https://www.puzzle-loop.com).
|
|
204
|
+
- Related repos like [puzzle_solver](https://github.com/Ar-Kareem/puzzle_solver) and [Puzzles-Solver](https://github.com/newtomsoft/Puzzles-Solver).
|
|
205
|
+
- [puzz.link](https://puzz.link) and [pzprjs](https://github.com/robx/pzprjs).
|
|
206
|
+
- [Nonogram solver](https://rosettacode.org/wiki/Nonogram_solver#Python).
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "puzzlekit"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "A comprehensive logic puzzle solver (60+) based on Google OR-Tools. e.g. Nonogram, Slitherlink, Akari, Yajilin, Hitori and Sudoku-variants."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
authors = [{name = "SmilingWayne", email = "xiaoxiaowayne@gmail.com"}]
|
|
12
|
+
license = {file = "LICENSE"}
|
|
13
|
+
keywords = ["puzzle", "solver", "logic", "cp-sat", "efficient", "python", "nonogram", "slitherlink", "yajilin", "hitori", "sudoku", "akari"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 3 - Alpha",
|
|
16
|
+
"Intended Audience :: Developers",
|
|
17
|
+
"Intended Audience :: Science/Research",
|
|
18
|
+
"License :: OSI Approved :: MIT License",
|
|
19
|
+
"Programming Language :: Python :: 3",
|
|
20
|
+
"Programming Language :: Python :: 3.10",
|
|
21
|
+
"Programming Language :: Python :: 3.11",
|
|
22
|
+
"Programming Language :: Python :: 3.12",
|
|
23
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
24
|
+
"Topic :: Games/Entertainment :: Puzzle Games",
|
|
25
|
+
"Operating System :: OS Independent",
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
dependencies = [
|
|
29
|
+
"numpy",
|
|
30
|
+
"ortools>=9.6",
|
|
31
|
+
"matplotlib",
|
|
32
|
+
"typeguard"
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
[tool.setuptools.packages.find]
|
|
36
|
+
where = ["src"]
|
|
37
|
+
include = ["puzzlekit*"]
|
|
38
|
+
|
|
39
|
+
[project.urls]
|
|
40
|
+
Homepage = "https://github.com/SmilingWayne/PuzzleSolver"
|
|
41
|
+
Repository = "https://github.com/SmilingWayne/PuzzleSolver"
|
|
42
|
+
Issues = "https://github.com/SmilingWayne/PuzzleSolver/issues"
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from typing import Dict, Any
|
|
2
|
+
from puzzlekit.solvers import get_solver_class
|
|
3
|
+
|
|
4
|
+
def solver(puzzle_type: str, data: Dict[str, Any] = None, **kwargs) -> Any:
|
|
5
|
+
|
|
6
|
+
init_params = (data or {}).copy()
|
|
7
|
+
init_params.update(kwargs)
|
|
8
|
+
|
|
9
|
+
SolverClass = get_solver_class(puzzle_type)
|
|
10
|
+
return SolverClass(**init_params)
|
|
11
|
+
|
|
12
|
+
__all__ = ["solver"]
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|