multi-puzzle-solver 1.0.8__tar.gz → 1.0.10__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.
Potentially problematic release.
This version of multi-puzzle-solver might be problematic. Click here for more details.
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/PKG-INFO +185 -20
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/README.md +183 -18
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/pyproject.toml +1 -1
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/multi_puzzle_solver.egg-info/PKG-INFO +185 -20
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/multi_puzzle_solver.egg-info/SOURCES.txt +4 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/__init__.py +5 -1
- multi_puzzle_solver-1.0.10/src/puzzle_solver/puzzles/binairo/binairo.py +98 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/flip/flip.py +14 -27
- multi_puzzle_solver-1.0.10/src/puzzle_solver/puzzles/n_queens/n_queens.py +81 -0
- multi_puzzle_solver-1.0.10/src/puzzle_solver/puzzles/split_ends/split_ends.py +94 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/stitches/parse_map/parse_map.py +28 -10
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_binairo.py +25 -0
- multi_puzzle_solver-1.0.10/tests/test_n_queens.py +76 -0
- multi_puzzle_solver-1.0.10/tests/test_split_ends.py +46 -0
- multi_puzzle_solver-1.0.8/src/puzzle_solver/puzzles/binairo/binairo.py +0 -126
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/setup.cfg +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/multi_puzzle_solver.egg-info/dependency_links.txt +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/multi_puzzle_solver.egg-info/requires.txt +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/multi_puzzle_solver.egg-info/top_level.txt +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/core/utils.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/core/utils_ortools.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/core/utils_visualizer.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/abc_view/abc_view.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/aquarium/aquarium.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/battleships/battleships.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/binairo/binairo_plus.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/black_box/black_box.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/bridges/bridges.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/chess_range/chess_melee.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/chess_range/chess_range.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/chess_range/chess_solo.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/connect_the_dots/connect_the_dots.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/dominosa/dominosa.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/filling/filling.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/flood_it/flood_it.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/flood_it/parse_map/parse_map.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/galaxies/galaxies.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/galaxies/parse_map/parse_map.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/guess/guess.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/heyawake/heyawake.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/inertia/inertia.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/inertia/parse_map/parse_map.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/inertia/tsp.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/kakurasu/kakurasu.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/kakuro/kakuro.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/keen/keen.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/light_up/light_up.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/lits/lits.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/magnets/magnets.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/map/map.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/mathema_grids/mathema_grids.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/minesweeper/minesweeper.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/mosaic/mosaic.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/nonograms/nonograms.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/nonograms/nonograms_colored.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/norinori/norinori.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/nurikabe/nurikabe.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/palisade/palisade.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/pearl/pearl.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/pipes/pipes.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/range/range.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/rectangles/rectangles.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/shakashaka/shakashaka.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/shingoki/shingoki.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/signpost/signpost.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/singles/singles.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/slant/parse_map/parse_map.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/slant/slant.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/slitherlink/slitherlink.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/star_battle/star_battle.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/star_battle/star_battle_shapeless.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/stitches/stitches.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/sudoku/sudoku.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/tapa/tapa.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/tents/tents.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/thermometers/thermometers.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/towers/towers.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/tracks/tracks.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/twiddle/twiddle.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/undead/undead.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/unequal/unequal.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/unruly/unruly.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/yin_yang/parse_map/parse_map.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/puzzles/yin_yang/yin_yang.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/src/puzzle_solver/utils/visualizer.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_abc_view.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_aquarium.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_battleships.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_binairo_plus.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_black_box.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_bridges.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_chess_melee.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_chess_range.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_chess_solo.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_connect_the_dots.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_dominosa.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_filling.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_flip.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_flood_it.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_galaxies.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_guess.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_heyawake.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_inertia.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_kakurasu.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_kakuro.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_keen.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_light_up.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_lits.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_magnets.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_map.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_mathema_grids.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_minesweeper.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_mosaic.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_nonograms.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_nonograms_colored.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_norinori.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_nurikabe.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_palisade.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_pearl.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_pipes.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_range.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_rectangles.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_shakashaka.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_shingoki.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_signpost.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_singles.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_slant.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_slitherlink.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_star_battle.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_stitches.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_sudoku.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_tapa.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_tents.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_thermometers.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_towers.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_tracks.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_twiddle.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_undead.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_unequal.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_unruly.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_utils.py +0 -0
- {multi_puzzle_solver-1.0.8 → multi_puzzle_solver-1.0.10}/tests/test_yin_yang.py +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: multi-puzzle-solver
|
|
3
|
-
Version: 1.0.
|
|
4
|
-
Summary: Efficient solvers for countless (
|
|
3
|
+
Version: 1.0.10
|
|
4
|
+
Summary: Efficient solvers for countless (60+) types of puzzles (like Sudoku, Minesweeper, etc.) with a simple python API.
|
|
5
5
|
Author: Ar-Kareem
|
|
6
6
|
Project-URL: Homepage, https://github.com/Ar-Kareem/puzzle_solver
|
|
7
7
|
Project-URL: Repository, https://github.com/Ar-Kareem/puzzle_solver
|
|
@@ -26,7 +26,7 @@ Requires-Dist: pytest-xdist; extra == "dev"
|
|
|
26
26
|
|
|
27
27
|
# Python Puzzle Solver
|
|
28
28
|
|
|
29
|
-
Solve countless (
|
|
29
|
+
Solve countless (60+) classical logic puzzles automatically in Python.
|
|
30
30
|
|
|
31
31
|
## Quick Start
|
|
32
32
|
|
|
@@ -73,7 +73,7 @@ Time taken: 0.04 seconds
|
|
|
73
73
|
|
|
74
74
|
## Introduction
|
|
75
75
|
|
|
76
|
-
The aim of this repo is to provide very efficient solvers (i.e. not brute force solvers) for countless (
|
|
76
|
+
The aim of this repo is to provide very efficient solvers (i.e. not brute force solvers) for countless (60+) popular pencil logic puzzles like Nonograms, Sudoku, Minesweeper, and many more lesser known ones.
|
|
77
77
|
|
|
78
78
|
If you happen to have a puzzle similar to the ones listed below and want to solve it (or see how many potential solutions a partially covered board has), then this repo is perfect for you.
|
|
79
79
|
|
|
@@ -417,6 +417,18 @@ These are all the puzzles that are implemented in this repo. <br> Click on any o
|
|
|
417
417
|
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/puzzles/mathema_grids_solved.png" alt="Mathema Grids" width="140">
|
|
418
418
|
</a>
|
|
419
419
|
</td>
|
|
420
|
+
<td align="center">
|
|
421
|
+
<a href="#split-ends-puzzle-type-60"><b>N-Queens</b><br><br>
|
|
422
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/puzzles/7_queens_solved.png" alt="N-Queens" width="140">
|
|
423
|
+
</a>
|
|
424
|
+
</td>
|
|
425
|
+
</tr>
|
|
426
|
+
<tr>
|
|
427
|
+
<td align="center">
|
|
428
|
+
<a href="#split-ends-puzzle-type-61"><b>Split Ends</b><br><br>
|
|
429
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/puzzles/split_ends_solved.png" alt="Split Ends" width="140">
|
|
430
|
+
</a>
|
|
431
|
+
</td>
|
|
420
432
|
</tr>
|
|
421
433
|
</table>
|
|
422
434
|
|
|
@@ -491,6 +503,8 @@ These are all the puzzles that are implemented in this repo. <br> Click on any o
|
|
|
491
503
|
- [Nonograms Colored (Puzzle Type #57)](#nonograms-colored-puzzle-type-57)
|
|
492
504
|
- [ABC View (Puzzle Type #58)](#abc-view-puzzle-type-58)
|
|
493
505
|
- [Mathema Grids (Puzzle Type #59)](#mathema-grids-puzzle-type-59)
|
|
506
|
+
- [Split Ends (Puzzle Type #61)](#split-ends-puzzle-type-61)
|
|
507
|
+
- [N-Queens (Puzzle Type #60)](#n-queens-puzzle-type-60)
|
|
494
508
|
- [Why SAT / CP-SAT?](#why-sat--cp-sat)
|
|
495
509
|
- [Testing](#testing)
|
|
496
510
|
- [Contributing](#contributing)
|
|
@@ -610,7 +624,15 @@ Time taken: 0.04 seconds
|
|
|
610
624
|
|
|
611
625
|
## Sudoku (Puzzle Type #2)
|
|
612
626
|
|
|
613
|
-
Also known as Number Place and Solo.
|
|
627
|
+
Also known as Number Place and Solo.
|
|
628
|
+
|
|
629
|
+
The code can:
|
|
630
|
+
|
|
631
|
+
1. Solve arbitrarily sized valid board sizes, thus can be used to solve:
|
|
632
|
+
- Hex Sudoku (a 16x16 variant)
|
|
633
|
+
- Kidoku (a kid-friendly sudoku variant)
|
|
634
|
+
2. Solve the ["Sandwich" sudoku variant](https://dkmgames.com/SandwichSudoku/) using the optional parameter `sandwich={'side': [...], 'bottom': [...]}`
|
|
635
|
+
3. Solve the ["Sudoku-X" variant](https://www.sudopedia.org/wiki/Sudoku-X) using the optional parameter `unique_diagonal=True`
|
|
614
636
|
|
|
615
637
|
* [**Play online**](https://www.chiark.greenend.org.uk/~sgtatham/puzzles/js/solo.html)
|
|
616
638
|
|
|
@@ -635,12 +657,6 @@ You are given some of the numbers as clues; your aim is to place the rest of the
|
|
|
635
657
|
|
|
636
658
|
Code to utilize this package and solve the puzzle:
|
|
637
659
|
|
|
638
|
-
Note:
|
|
639
|
-
|
|
640
|
-
- The solver also supports solving the ["Sandwich" sudoku variant](https://dkmgames.com/SandwichSudoku/) through the optional parameter ``sandwich={'side': [...], 'bottom': [...] }``。
|
|
641
|
-
|
|
642
|
-
- The solver also supports solving the ["Sudoku-X" variant](https://www.sudopedia.org/wiki/Sudoku-X) through the optional parameter ``unique_diagonal=True``。
|
|
643
|
-
|
|
644
660
|
```python
|
|
645
661
|
import numpy as np
|
|
646
662
|
from puzzle_solver import sudoku_solver as solver
|
|
@@ -1105,7 +1121,7 @@ Time taken: 0.15 seconds
|
|
|
1105
1121
|
|
|
1106
1122
|
## Keen (Puzzle Type #8)
|
|
1107
1123
|
|
|
1108
|
-
Also known as KenKen or
|
|
1124
|
+
Also known as KenKen, CalcuDoku, Inkies, or Inky.
|
|
1109
1125
|
|
|
1110
1126
|
* [**Play online**](https://www.chiark.greenend.org.uk/~sgtatham/puzzles/js/keen.html)
|
|
1111
1127
|
|
|
@@ -4043,6 +4059,8 @@ Applying the solution to the puzzle visually:
|
|
|
4043
4059
|
|
|
4044
4060
|
## Binairo (Puzzle Type #41)
|
|
4045
4061
|
|
|
4062
|
+
Also known as Takuzu, Binero, Tohu-Wa-Vohu (Formless and Empty), Eins und Zwei (One and Two), Binary Puzzles, Binoxxo, Binox, Zernero, Tic-Tac-Logic, and Sudoku Binary.
|
|
4063
|
+
|
|
4046
4064
|
* [**Play online**](https://www.puzzle-binairo.com)
|
|
4047
4065
|
|
|
4048
4066
|
* [**Solver Code**][41]
|
|
@@ -4395,19 +4413,30 @@ solutions = binst.solve_and_print()
|
|
|
4395
4413
|
|
|
4396
4414
|
**Script Output**
|
|
4397
4415
|
|
|
4398
|
-
The output tells you which squares to tap to solve the puzzle.
|
|
4416
|
+
The output tells you which squares to tap to solve the puzzle, the shaded squares are the ones that need to be tapped.
|
|
4399
4417
|
|
|
4400
4418
|
```python
|
|
4401
4419
|
Solution found
|
|
4402
|
-
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4407
|
-
|
|
4408
|
-
|
|
4420
|
+
|
|
4421
|
+
0 1 2 3 4 5 6
|
|
4422
|
+
┌───┬───┬───┬───┬───┬───┬───┐
|
|
4423
|
+
0│▒▒▒│ │▒▒▒│▒▒▒│▒▒▒│ │ │
|
|
4424
|
+
├───┼───┼───┼───┼───┼───┼───┤
|
|
4425
|
+
1│ │ │ │▒▒▒│ │▒▒▒│ │
|
|
4426
|
+
├───┼───┼───┼───┼───┼───┼───┤
|
|
4427
|
+
2│ │▒▒▒│ │ │▒▒▒│ │ │
|
|
4428
|
+
├───┼───┼───┼───┼───┼───┼───┤
|
|
4429
|
+
3│▒▒▒│ │▒▒▒│ │ │▒▒▒│ │
|
|
4430
|
+
├───┼───┼───┼───┼───┼───┼───┤
|
|
4431
|
+
4│ │ │ │▒▒▒│ │ │▒▒▒│
|
|
4432
|
+
├───┼───┼───┼───┼───┼───┼───┤
|
|
4433
|
+
5│▒▒▒│ │▒▒▒│ │▒▒▒│▒▒▒│▒▒▒│
|
|
4434
|
+
├───┼───┼───┼───┼───┼───┼───┤
|
|
4435
|
+
6│ │ │ │ │ │▒▒▒│▒▒▒│
|
|
4436
|
+
└───┴───┴───┴───┴───┴───┴───┘
|
|
4409
4437
|
Solutions found: 1
|
|
4410
4438
|
status: OPTIMAL
|
|
4439
|
+
Time taken: 0.01 seconds
|
|
4411
4440
|
```
|
|
4412
4441
|
|
|
4413
4442
|
**Solved puzzle**
|
|
@@ -5942,6 +5971,142 @@ Time taken: 0.00 seconds
|
|
|
5942
5971
|
|
|
5943
5972
|
---
|
|
5944
5973
|
|
|
5974
|
+
## Split Ends (Puzzle Type #61)
|
|
5975
|
+
|
|
5976
|
+
* [**Play online**](https://krazydad.com/play/splitends/)
|
|
5977
|
+
|
|
5978
|
+
* [**Solver Code**](https://github.com/Ar-Kareem/puzzle_solver/tree/master/src/puzzle_solver/puzzles/split_ends)
|
|
5979
|
+
|
|
5980
|
+
<details>
|
|
5981
|
+
<summary><strong>Rules</strong></summary>
|
|
5982
|
+
|
|
5983
|
+
Each row and column contains four unique Y shapes (four different orientations) and two Os. Ys should not form straight lines by touching other Ys.
|
|
5984
|
+
|
|
5985
|
+
</details>
|
|
5986
|
+
|
|
5987
|
+
**Unsolved puzzle**
|
|
5988
|
+
|
|
5989
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/puzzles/split_ends_unsolved.png" alt="Split Ends unsolved" width="500">
|
|
5990
|
+
|
|
5991
|
+
Code to utilize this package and solve the puzzle:
|
|
5992
|
+
|
|
5993
|
+
```python
|
|
5994
|
+
import numpy as np
|
|
5995
|
+
from puzzle_solver import split_ends_solver as solver
|
|
5996
|
+
board = np.array([
|
|
5997
|
+
['O', ' ', 'O', 'L', ' ', 'U'],
|
|
5998
|
+
[' ', ' ', ' ', ' ', ' ', ' '],
|
|
5999
|
+
[' ', 'R', ' ', ' ', 'O', ' '],
|
|
6000
|
+
[' ', 'O', ' ', ' ', 'L', ' '],
|
|
6001
|
+
[' ', ' ', ' ', ' ', ' ', ' '],
|
|
6002
|
+
['U', ' ', 'L', 'D', ' ', 'R'],
|
|
6003
|
+
])
|
|
6004
|
+
binst = solver.Board(board=board)
|
|
6005
|
+
solutions = binst.solve_and_print()
|
|
6006
|
+
```
|
|
6007
|
+
|
|
6008
|
+
**Script Output**
|
|
6009
|
+
|
|
6010
|
+
```python
|
|
6011
|
+
Solution found
|
|
6012
|
+
|
|
6013
|
+
0 1 2 3 4 5
|
|
6014
|
+
┌───┬───┬───┬───┬───┬───┐
|
|
6015
|
+
0│ O │ D │ O │ L │ R │ U │
|
|
6016
|
+
├───┼───┼───┼───┼───┼───┤
|
|
6017
|
+
1│ O │ L │ D │ R │ U │ O │
|
|
6018
|
+
├───┼───┼───┼───┼───┼───┤
|
|
6019
|
+
2│ D │ R │ O │ U │ O │ L │
|
|
6020
|
+
├───┼───┼───┼───┼───┼───┤
|
|
6021
|
+
3│ R │ O │ U │ O │ L │ D │
|
|
6022
|
+
├───┼───┼───┼───┼───┼───┤
|
|
6023
|
+
4│ L │ U │ R │ O │ D │ O │
|
|
6024
|
+
├───┼───┼───┼───┼───┼───┤
|
|
6025
|
+
5│ U │ O │ L │ D │ O │ R │
|
|
6026
|
+
└───┴───┴───┴───┴───┴───┘
|
|
6027
|
+
Solutions found: 1
|
|
6028
|
+
status: OPTIMAL
|
|
6029
|
+
Time taken: 0.01 seconds
|
|
6030
|
+
```
|
|
6031
|
+
|
|
6032
|
+
**Solved puzzle**
|
|
6033
|
+
|
|
6034
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/puzzles/split_ends_solved.png" alt="Split Ends solved" width="500">
|
|
6035
|
+
|
|
6036
|
+
---
|
|
6037
|
+
|
|
6038
|
+
## N-Queens (Puzzle Type #60)
|
|
6039
|
+
|
|
6040
|
+
Can also solve puzzles such as 7-Queens.
|
|
6041
|
+
|
|
6042
|
+
* [**Play online**](https://krazydad.com/play/queens/)
|
|
6043
|
+
|
|
6044
|
+
* [**Solver Code**](https://github.com/Ar-Kareem/puzzle_solver/tree/master/src/puzzle_solver/puzzles/n_queens)
|
|
6045
|
+
|
|
6046
|
+
<details>
|
|
6047
|
+
<summary><strong>Rules</strong></summary>
|
|
6048
|
+
|
|
6049
|
+
7-Queens Variant: Within each of the seven realms lives a lone queen. To maintain the peace, queens must not threaten each other: no row, column, diagonal, nor region may have more than one queen!
|
|
6050
|
+
|
|
6051
|
+
</details>
|
|
6052
|
+
|
|
6053
|
+
**Unsolved puzzle**
|
|
6054
|
+
|
|
6055
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/puzzles/7_queens_unsolved.png" alt="7 Queens unsolved" width="500">
|
|
6056
|
+
|
|
6057
|
+
Code to utilize this package and solve the puzzle:
|
|
6058
|
+
|
|
6059
|
+
```python
|
|
6060
|
+
import numpy as np
|
|
6061
|
+
from puzzle_solver import n_queens_solver as solver
|
|
6062
|
+
board = np.array([
|
|
6063
|
+
['00', '00', '00', '00', '01', '01', '02', '02'],
|
|
6064
|
+
['00', '00', '03', '03', '01', '01', '02', '04'],
|
|
6065
|
+
['00', '00', '03', '03', '01', '01', '01', '04'],
|
|
6066
|
+
['03', '03', '03', '03', '01', '01', '01', '05'],
|
|
6067
|
+
['03', '03', '03', '03', '01', '01', '01', '05'],
|
|
6068
|
+
['03', '03', '06', '06', '06', '05', '05', '05'],
|
|
6069
|
+
['06', '06', '06', '06', '06', '06', '05', '05'],
|
|
6070
|
+
['06', '06', '06', '06', '06', '06', '05', '05']
|
|
6071
|
+
])
|
|
6072
|
+
binst = solver.Board(board=board)
|
|
6073
|
+
solutions = binst.solve_and_print()
|
|
6074
|
+
```
|
|
6075
|
+
|
|
6076
|
+
**Script Output**
|
|
6077
|
+
|
|
6078
|
+
```python
|
|
6079
|
+
Solution found
|
|
6080
|
+
|
|
6081
|
+
0 1 2 3 4 5 6 7
|
|
6082
|
+
┌───┬───┬───┬───┬───┬───┬───┬───┐
|
|
6083
|
+
0│ │ │ │ │ │ │▒▒▒│ │
|
|
6084
|
+
├───┼───┼───┼───┼───┼───┼───┼───┤
|
|
6085
|
+
1│▒▒▒│ │ │ │ │ │ │ │
|
|
6086
|
+
├───┼───┼───┼───┼───┼───┼───┼───┤
|
|
6087
|
+
2│ │ │ │ │ │ │ │▒▒▒│
|
|
6088
|
+
├───┼───┼───┼───┼───┼───┼───┼───┤
|
|
6089
|
+
3│ │ │ │ │▒▒▒│ │ │ │
|
|
6090
|
+
├───┼───┼───┼───┼───┼───┼───┼───┤
|
|
6091
|
+
4│ │▒▒▒│ │ │ │ │ │ │
|
|
6092
|
+
├───┼───┼───┼───┼───┼───┼───┼───┤
|
|
6093
|
+
5│ │ │ │ │ │▒▒▒│ │ │
|
|
6094
|
+
├───┼───┼───┼───┼───┼───┼───┼───┤
|
|
6095
|
+
6│ │ │▒▒▒│ │ │ │ │ │
|
|
6096
|
+
├───┼───┼───┼───┼───┼───┼───┼───┤
|
|
6097
|
+
7│ │ │ │ │ │ │ │ │
|
|
6098
|
+
└───┴───┴───┴───┴───┴───┴───┴───┘
|
|
6099
|
+
Solutions found: 1
|
|
6100
|
+
status: OPTIMAL
|
|
6101
|
+
Time taken: 0.00 seconds
|
|
6102
|
+
```
|
|
6103
|
+
|
|
6104
|
+
**Solved puzzle**
|
|
6105
|
+
|
|
6106
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/puzzles/7_queens_solved.png" alt="7 Queens solved" width="500">
|
|
6107
|
+
|
|
6108
|
+
---
|
|
6109
|
+
|
|
5945
6110
|
---
|
|
5946
6111
|
|
|
5947
6112
|
## Why SAT / CP-SAT?
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Python Puzzle Solver
|
|
2
2
|
|
|
3
|
-
Solve countless (
|
|
3
|
+
Solve countless (60+) classical logic puzzles automatically in Python.
|
|
4
4
|
|
|
5
5
|
## Quick Start
|
|
6
6
|
|
|
@@ -47,7 +47,7 @@ Time taken: 0.04 seconds
|
|
|
47
47
|
|
|
48
48
|
## Introduction
|
|
49
49
|
|
|
50
|
-
The aim of this repo is to provide very efficient solvers (i.e. not brute force solvers) for countless (
|
|
50
|
+
The aim of this repo is to provide very efficient solvers (i.e. not brute force solvers) for countless (60+) popular pencil logic puzzles like Nonograms, Sudoku, Minesweeper, and many more lesser known ones.
|
|
51
51
|
|
|
52
52
|
If you happen to have a puzzle similar to the ones listed below and want to solve it (or see how many potential solutions a partially covered board has), then this repo is perfect for you.
|
|
53
53
|
|
|
@@ -391,6 +391,18 @@ These are all the puzzles that are implemented in this repo. <br> Click on any o
|
|
|
391
391
|
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/puzzles/mathema_grids_solved.png" alt="Mathema Grids" width="140">
|
|
392
392
|
</a>
|
|
393
393
|
</td>
|
|
394
|
+
<td align="center">
|
|
395
|
+
<a href="#split-ends-puzzle-type-60"><b>N-Queens</b><br><br>
|
|
396
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/puzzles/7_queens_solved.png" alt="N-Queens" width="140">
|
|
397
|
+
</a>
|
|
398
|
+
</td>
|
|
399
|
+
</tr>
|
|
400
|
+
<tr>
|
|
401
|
+
<td align="center">
|
|
402
|
+
<a href="#split-ends-puzzle-type-61"><b>Split Ends</b><br><br>
|
|
403
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/puzzles/split_ends_solved.png" alt="Split Ends" width="140">
|
|
404
|
+
</a>
|
|
405
|
+
</td>
|
|
394
406
|
</tr>
|
|
395
407
|
</table>
|
|
396
408
|
|
|
@@ -465,6 +477,8 @@ These are all the puzzles that are implemented in this repo. <br> Click on any o
|
|
|
465
477
|
- [Nonograms Colored (Puzzle Type #57)](#nonograms-colored-puzzle-type-57)
|
|
466
478
|
- [ABC View (Puzzle Type #58)](#abc-view-puzzle-type-58)
|
|
467
479
|
- [Mathema Grids (Puzzle Type #59)](#mathema-grids-puzzle-type-59)
|
|
480
|
+
- [Split Ends (Puzzle Type #61)](#split-ends-puzzle-type-61)
|
|
481
|
+
- [N-Queens (Puzzle Type #60)](#n-queens-puzzle-type-60)
|
|
468
482
|
- [Why SAT / CP-SAT?](#why-sat--cp-sat)
|
|
469
483
|
- [Testing](#testing)
|
|
470
484
|
- [Contributing](#contributing)
|
|
@@ -584,7 +598,15 @@ Time taken: 0.04 seconds
|
|
|
584
598
|
|
|
585
599
|
## Sudoku (Puzzle Type #2)
|
|
586
600
|
|
|
587
|
-
Also known as Number Place and Solo.
|
|
601
|
+
Also known as Number Place and Solo.
|
|
602
|
+
|
|
603
|
+
The code can:
|
|
604
|
+
|
|
605
|
+
1. Solve arbitrarily sized valid board sizes, thus can be used to solve:
|
|
606
|
+
- Hex Sudoku (a 16x16 variant)
|
|
607
|
+
- Kidoku (a kid-friendly sudoku variant)
|
|
608
|
+
2. Solve the ["Sandwich" sudoku variant](https://dkmgames.com/SandwichSudoku/) using the optional parameter `sandwich={'side': [...], 'bottom': [...]}`
|
|
609
|
+
3. Solve the ["Sudoku-X" variant](https://www.sudopedia.org/wiki/Sudoku-X) using the optional parameter `unique_diagonal=True`
|
|
588
610
|
|
|
589
611
|
* [**Play online**](https://www.chiark.greenend.org.uk/~sgtatham/puzzles/js/solo.html)
|
|
590
612
|
|
|
@@ -609,12 +631,6 @@ You are given some of the numbers as clues; your aim is to place the rest of the
|
|
|
609
631
|
|
|
610
632
|
Code to utilize this package and solve the puzzle:
|
|
611
633
|
|
|
612
|
-
Note:
|
|
613
|
-
|
|
614
|
-
- The solver also supports solving the ["Sandwich" sudoku variant](https://dkmgames.com/SandwichSudoku/) through the optional parameter ``sandwich={'side': [...], 'bottom': [...] }``。
|
|
615
|
-
|
|
616
|
-
- The solver also supports solving the ["Sudoku-X" variant](https://www.sudopedia.org/wiki/Sudoku-X) through the optional parameter ``unique_diagonal=True``。
|
|
617
|
-
|
|
618
634
|
```python
|
|
619
635
|
import numpy as np
|
|
620
636
|
from puzzle_solver import sudoku_solver as solver
|
|
@@ -1079,7 +1095,7 @@ Time taken: 0.15 seconds
|
|
|
1079
1095
|
|
|
1080
1096
|
## Keen (Puzzle Type #8)
|
|
1081
1097
|
|
|
1082
|
-
Also known as KenKen or
|
|
1098
|
+
Also known as KenKen, CalcuDoku, Inkies, or Inky.
|
|
1083
1099
|
|
|
1084
1100
|
* [**Play online**](https://www.chiark.greenend.org.uk/~sgtatham/puzzles/js/keen.html)
|
|
1085
1101
|
|
|
@@ -4017,6 +4033,8 @@ Applying the solution to the puzzle visually:
|
|
|
4017
4033
|
|
|
4018
4034
|
## Binairo (Puzzle Type #41)
|
|
4019
4035
|
|
|
4036
|
+
Also known as Takuzu, Binero, Tohu-Wa-Vohu (Formless and Empty), Eins und Zwei (One and Two), Binary Puzzles, Binoxxo, Binox, Zernero, Tic-Tac-Logic, and Sudoku Binary.
|
|
4037
|
+
|
|
4020
4038
|
* [**Play online**](https://www.puzzle-binairo.com)
|
|
4021
4039
|
|
|
4022
4040
|
* [**Solver Code**][41]
|
|
@@ -4369,19 +4387,30 @@ solutions = binst.solve_and_print()
|
|
|
4369
4387
|
|
|
4370
4388
|
**Script Output**
|
|
4371
4389
|
|
|
4372
|
-
The output tells you which squares to tap to solve the puzzle.
|
|
4390
|
+
The output tells you which squares to tap to solve the puzzle, the shaded squares are the ones that need to be tapped.
|
|
4373
4391
|
|
|
4374
4392
|
```python
|
|
4375
4393
|
Solution found
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4394
|
+
|
|
4395
|
+
0 1 2 3 4 5 6
|
|
4396
|
+
┌───┬───┬───┬───┬───┬───┬───┐
|
|
4397
|
+
0│▒▒▒│ │▒▒▒│▒▒▒│▒▒▒│ │ │
|
|
4398
|
+
├───┼───┼───┼───┼───┼───┼───┤
|
|
4399
|
+
1│ │ │ │▒▒▒│ │▒▒▒│ │
|
|
4400
|
+
├───┼───┼───┼───┼───┼───┼───┤
|
|
4401
|
+
2│ │▒▒▒│ │ │▒▒▒│ │ │
|
|
4402
|
+
├───┼───┼───┼───┼───┼───┼───┤
|
|
4403
|
+
3│▒▒▒│ │▒▒▒│ │ │▒▒▒│ │
|
|
4404
|
+
├───┼───┼───┼───┼───┼───┼───┤
|
|
4405
|
+
4│ │ │ │▒▒▒│ │ │▒▒▒│
|
|
4406
|
+
├───┼───┼───┼───┼───┼───┼───┤
|
|
4407
|
+
5│▒▒▒│ │▒▒▒│ │▒▒▒│▒▒▒│▒▒▒│
|
|
4408
|
+
├───┼───┼───┼───┼───┼───┼───┤
|
|
4409
|
+
6│ │ │ │ │ │▒▒▒│▒▒▒│
|
|
4410
|
+
└───┴───┴───┴───┴───┴───┴───┘
|
|
4383
4411
|
Solutions found: 1
|
|
4384
4412
|
status: OPTIMAL
|
|
4413
|
+
Time taken: 0.01 seconds
|
|
4385
4414
|
```
|
|
4386
4415
|
|
|
4387
4416
|
**Solved puzzle**
|
|
@@ -5916,6 +5945,142 @@ Time taken: 0.00 seconds
|
|
|
5916
5945
|
|
|
5917
5946
|
---
|
|
5918
5947
|
|
|
5948
|
+
## Split Ends (Puzzle Type #61)
|
|
5949
|
+
|
|
5950
|
+
* [**Play online**](https://krazydad.com/play/splitends/)
|
|
5951
|
+
|
|
5952
|
+
* [**Solver Code**](https://github.com/Ar-Kareem/puzzle_solver/tree/master/src/puzzle_solver/puzzles/split_ends)
|
|
5953
|
+
|
|
5954
|
+
<details>
|
|
5955
|
+
<summary><strong>Rules</strong></summary>
|
|
5956
|
+
|
|
5957
|
+
Each row and column contains four unique Y shapes (four different orientations) and two Os. Ys should not form straight lines by touching other Ys.
|
|
5958
|
+
|
|
5959
|
+
</details>
|
|
5960
|
+
|
|
5961
|
+
**Unsolved puzzle**
|
|
5962
|
+
|
|
5963
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/puzzles/split_ends_unsolved.png" alt="Split Ends unsolved" width="500">
|
|
5964
|
+
|
|
5965
|
+
Code to utilize this package and solve the puzzle:
|
|
5966
|
+
|
|
5967
|
+
```python
|
|
5968
|
+
import numpy as np
|
|
5969
|
+
from puzzle_solver import split_ends_solver as solver
|
|
5970
|
+
board = np.array([
|
|
5971
|
+
['O', ' ', 'O', 'L', ' ', 'U'],
|
|
5972
|
+
[' ', ' ', ' ', ' ', ' ', ' '],
|
|
5973
|
+
[' ', 'R', ' ', ' ', 'O', ' '],
|
|
5974
|
+
[' ', 'O', ' ', ' ', 'L', ' '],
|
|
5975
|
+
[' ', ' ', ' ', ' ', ' ', ' '],
|
|
5976
|
+
['U', ' ', 'L', 'D', ' ', 'R'],
|
|
5977
|
+
])
|
|
5978
|
+
binst = solver.Board(board=board)
|
|
5979
|
+
solutions = binst.solve_and_print()
|
|
5980
|
+
```
|
|
5981
|
+
|
|
5982
|
+
**Script Output**
|
|
5983
|
+
|
|
5984
|
+
```python
|
|
5985
|
+
Solution found
|
|
5986
|
+
|
|
5987
|
+
0 1 2 3 4 5
|
|
5988
|
+
┌───┬───┬───┬───┬───┬───┐
|
|
5989
|
+
0│ O │ D │ O │ L │ R │ U │
|
|
5990
|
+
├───┼───┼───┼───┼───┼───┤
|
|
5991
|
+
1│ O │ L │ D │ R │ U │ O │
|
|
5992
|
+
├───┼───┼───┼───┼───┼───┤
|
|
5993
|
+
2│ D │ R │ O │ U │ O │ L │
|
|
5994
|
+
├───┼───┼───┼───┼───┼───┤
|
|
5995
|
+
3│ R │ O │ U │ O │ L │ D │
|
|
5996
|
+
├───┼───┼───┼───┼───┼───┤
|
|
5997
|
+
4│ L │ U │ R │ O │ D │ O │
|
|
5998
|
+
├───┼───┼───┼───┼───┼───┤
|
|
5999
|
+
5│ U │ O │ L │ D │ O │ R │
|
|
6000
|
+
└───┴───┴───┴───┴───┴───┘
|
|
6001
|
+
Solutions found: 1
|
|
6002
|
+
status: OPTIMAL
|
|
6003
|
+
Time taken: 0.01 seconds
|
|
6004
|
+
```
|
|
6005
|
+
|
|
6006
|
+
**Solved puzzle**
|
|
6007
|
+
|
|
6008
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/puzzles/split_ends_solved.png" alt="Split Ends solved" width="500">
|
|
6009
|
+
|
|
6010
|
+
---
|
|
6011
|
+
|
|
6012
|
+
## N-Queens (Puzzle Type #60)
|
|
6013
|
+
|
|
6014
|
+
Can also solve puzzles such as 7-Queens.
|
|
6015
|
+
|
|
6016
|
+
* [**Play online**](https://krazydad.com/play/queens/)
|
|
6017
|
+
|
|
6018
|
+
* [**Solver Code**](https://github.com/Ar-Kareem/puzzle_solver/tree/master/src/puzzle_solver/puzzles/n_queens)
|
|
6019
|
+
|
|
6020
|
+
<details>
|
|
6021
|
+
<summary><strong>Rules</strong></summary>
|
|
6022
|
+
|
|
6023
|
+
7-Queens Variant: Within each of the seven realms lives a lone queen. To maintain the peace, queens must not threaten each other: no row, column, diagonal, nor region may have more than one queen!
|
|
6024
|
+
|
|
6025
|
+
</details>
|
|
6026
|
+
|
|
6027
|
+
**Unsolved puzzle**
|
|
6028
|
+
|
|
6029
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/puzzles/7_queens_unsolved.png" alt="7 Queens unsolved" width="500">
|
|
6030
|
+
|
|
6031
|
+
Code to utilize this package and solve the puzzle:
|
|
6032
|
+
|
|
6033
|
+
```python
|
|
6034
|
+
import numpy as np
|
|
6035
|
+
from puzzle_solver import n_queens_solver as solver
|
|
6036
|
+
board = np.array([
|
|
6037
|
+
['00', '00', '00', '00', '01', '01', '02', '02'],
|
|
6038
|
+
['00', '00', '03', '03', '01', '01', '02', '04'],
|
|
6039
|
+
['00', '00', '03', '03', '01', '01', '01', '04'],
|
|
6040
|
+
['03', '03', '03', '03', '01', '01', '01', '05'],
|
|
6041
|
+
['03', '03', '03', '03', '01', '01', '01', '05'],
|
|
6042
|
+
['03', '03', '06', '06', '06', '05', '05', '05'],
|
|
6043
|
+
['06', '06', '06', '06', '06', '06', '05', '05'],
|
|
6044
|
+
['06', '06', '06', '06', '06', '06', '05', '05']
|
|
6045
|
+
])
|
|
6046
|
+
binst = solver.Board(board=board)
|
|
6047
|
+
solutions = binst.solve_and_print()
|
|
6048
|
+
```
|
|
6049
|
+
|
|
6050
|
+
**Script Output**
|
|
6051
|
+
|
|
6052
|
+
```python
|
|
6053
|
+
Solution found
|
|
6054
|
+
|
|
6055
|
+
0 1 2 3 4 5 6 7
|
|
6056
|
+
┌───┬───┬───┬───┬───┬───┬───┬───┐
|
|
6057
|
+
0│ │ │ │ │ │ │▒▒▒│ │
|
|
6058
|
+
├───┼───┼───┼───┼───┼───┼───┼───┤
|
|
6059
|
+
1│▒▒▒│ │ │ │ │ │ │ │
|
|
6060
|
+
├───┼───┼───┼───┼───┼───┼───┼───┤
|
|
6061
|
+
2│ │ │ │ │ │ │ │▒▒▒│
|
|
6062
|
+
├───┼───┼───┼───┼───┼───┼───┼───┤
|
|
6063
|
+
3│ │ │ │ │▒▒▒│ │ │ │
|
|
6064
|
+
├───┼───┼───┼───┼───┼───┼───┼───┤
|
|
6065
|
+
4│ │▒▒▒│ │ │ │ │ │ │
|
|
6066
|
+
├───┼───┼───┼───┼───┼───┼───┼───┤
|
|
6067
|
+
5│ │ │ │ │ │▒▒▒│ │ │
|
|
6068
|
+
├───┼───┼───┼───┼───┼───┼───┼───┤
|
|
6069
|
+
6│ │ │▒▒▒│ │ │ │ │ │
|
|
6070
|
+
├───┼───┼───┼───┼───┼───┼───┼───┤
|
|
6071
|
+
7│ │ │ │ │ │ │ │ │
|
|
6072
|
+
└───┴───┴───┴───┴───┴───┴───┴───┘
|
|
6073
|
+
Solutions found: 1
|
|
6074
|
+
status: OPTIMAL
|
|
6075
|
+
Time taken: 0.00 seconds
|
|
6076
|
+
```
|
|
6077
|
+
|
|
6078
|
+
**Solved puzzle**
|
|
6079
|
+
|
|
6080
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/puzzles/7_queens_solved.png" alt="7 Queens solved" width="500">
|
|
6081
|
+
|
|
6082
|
+
---
|
|
6083
|
+
|
|
5919
6084
|
---
|
|
5920
6085
|
|
|
5921
6086
|
## Why SAT / CP-SAT?
|
|
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "multi-puzzle-solver"
|
|
7
7
|
dynamic = ["version"]
|
|
8
|
-
description = "Efficient solvers for countless (
|
|
8
|
+
description = "Efficient solvers for countless (60+) types of puzzles (like Sudoku, Minesweeper, etc.) with a simple python API."
|
|
9
9
|
readme = { file = "README.md", content-type = "text/markdown" }
|
|
10
10
|
requires-python = ">=3.9"
|
|
11
11
|
authors = [{name = "Ar-Kareem"}]
|