multi-puzzle-solver 0.9.3__tar.gz → 0.9.4__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.
- {multi_puzzle_solver-0.9.3/src/multi_puzzle_solver.egg-info → multi_puzzle_solver-0.9.4}/PKG-INFO +91 -5
- multi_puzzle_solver-0.9.3/PKG-INFO → multi_puzzle_solver-0.9.4/README.md +2405 -2345
- multi_puzzle_solver-0.9.3/README.md → multi_puzzle_solver-0.9.4/src/multi_puzzle_solver.egg-info/PKG-INFO +2431 -2319
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/src/multi_puzzle_solver.egg-info/SOURCES.txt +3 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/src/puzzle_solver/__init__.py +2 -1
- multi_puzzle_solver-0.9.4/src/puzzle_solver/puzzles/stitches/parse_map/parse_map.py +209 -0
- multi_puzzle_solver-0.9.4/src/puzzle_solver/puzzles/stitches/stitches.py +111 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/src/puzzle_solver/utils/visualizer.py +50 -24
- multi_puzzle_solver-0.9.4/tests/test_stitches.py +83 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/pyproject.toml +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/setup.cfg +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/src/multi_puzzle_solver.egg-info/dependency_links.txt +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/src/multi_puzzle_solver.egg-info/requires.txt +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/src/multi_puzzle_solver.egg-info/top_level.txt +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/src/puzzle_solver/core/utils.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/src/puzzle_solver/core/utils_ortools.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/src/puzzle_solver/puzzles/aquarium/aquarium.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/src/puzzle_solver/puzzles/bridges/bridges.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/src/puzzle_solver/puzzles/chess_range/chess_melee.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/src/puzzle_solver/puzzles/chess_range/chess_range.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/src/puzzle_solver/puzzles/chess_range/chess_solo.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/src/puzzle_solver/puzzles/dominosa/dominosa.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/src/puzzle_solver/puzzles/filling/filling.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/src/puzzle_solver/puzzles/guess/guess.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/src/puzzle_solver/puzzles/inertia/inertia.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/src/puzzle_solver/puzzles/inertia/parse_map/parse_map.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/src/puzzle_solver/puzzles/inertia/tsp.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/src/puzzle_solver/puzzles/keen/keen.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/src/puzzle_solver/puzzles/light_up/light_up.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/src/puzzle_solver/puzzles/magnets/magnets.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/src/puzzle_solver/puzzles/map/map.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/src/puzzle_solver/puzzles/minesweeper/minesweeper.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/src/puzzle_solver/puzzles/mosaic/mosaic.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/src/puzzle_solver/puzzles/nonograms/nonograms.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/src/puzzle_solver/puzzles/pearl/pearl.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/src/puzzle_solver/puzzles/range/range.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/src/puzzle_solver/puzzles/signpost/signpost.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/src/puzzle_solver/puzzles/singles/singles.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/src/puzzle_solver/puzzles/sudoku/sudoku.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/src/puzzle_solver/puzzles/tents/tents.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/src/puzzle_solver/puzzles/thermometers/thermometers.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/src/puzzle_solver/puzzles/towers/towers.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/src/puzzle_solver/puzzles/tracks/tracks.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/src/puzzle_solver/puzzles/undead/undead.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/src/puzzle_solver/puzzles/unruly/unruly.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/tests/test_aquarium.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/tests/test_bridges.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/tests/test_chess_melee.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/tests/test_chess_range.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/tests/test_chess_solo.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/tests/test_dominosa.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/tests/test_filling.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/tests/test_guess.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/tests/test_inertia.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/tests/test_keen.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/tests/test_light_up.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/tests/test_magnets.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/tests/test_map.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/tests/test_minesweeper.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/tests/test_mosaic.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/tests/test_nonograms.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/tests/test_pearl.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/tests/test_range.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/tests/test_signpost.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/tests/test_singles.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/tests/test_sudoku.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/tests/test_tents.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/tests/test_thermometers.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/tests/test_towers.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/tests/test_tracks.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/tests/test_undead.py +0 -0
- {multi_puzzle_solver-0.9.3 → multi_puzzle_solver-0.9.4}/tests/test_unruly.py +0 -0
{multi_puzzle_solver-0.9.3/src/multi_puzzle_solver.egg-info → multi_puzzle_solver-0.9.4}/PKG-INFO
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: multi-puzzle-solver
|
3
|
-
Version: 0.9.
|
3
|
+
Version: 0.9.4
|
4
4
|
Summary: Efficient solvers for numerous popular and esoteric logic puzzles using CP-SAT
|
5
5
|
Author: Ar-Kareem
|
6
6
|
Project-URL: Homepage, https://github.com/Ar-Kareem/puzzle_solver
|
@@ -232,6 +232,11 @@ These are all the puzzles that are implemented in this repo. <br> Click on any o
|
|
232
232
|
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/aquarium_solved.png" alt="Aquarium" width="140">
|
233
233
|
</a>
|
234
234
|
</td>
|
235
|
+
<td align="center">
|
236
|
+
<a href="#stitches-puzzle-type-28"><b>Stitches</b><br><br>
|
237
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/stitches_solved.png" alt="Stitches" width="140">
|
238
|
+
</a>
|
239
|
+
</td>
|
235
240
|
</tr>
|
236
241
|
</table>
|
237
242
|
|
@@ -274,6 +279,7 @@ These are all the puzzles that are implemented in this repo. <br> Click on any o
|
|
274
279
|
- [Chess Melee (Puzzle Type #25)](#chess-melee-puzzle-type-25)
|
275
280
|
- [Thermometers (Puzzle Type #26)](#thermometers-puzzle-type-26)
|
276
281
|
- [Aquarium (Puzzle Type #27)](#aquarium-puzzle-type-27)
|
282
|
+
- [Stitches (Puzzle Type #28)](#stitches-puzzle-type-28)
|
277
283
|
- [Why SAT / CP-SAT?](#why-sat--cp-sat)
|
278
284
|
- [Testing](#testing)
|
279
285
|
- [Contributing](#contributing)
|
@@ -2134,8 +2140,6 @@ The numbers outside the grid show the number of filled cells horizontally and ve
|
|
2134
2140
|
|
2135
2141
|
Code to utilize this package and solve the puzzle:
|
2136
2142
|
|
2137
|
-
(Note that this puzzle does not typically have a unique solution. Thus, we specify here that we only want the first valid solution that the solver finds.)
|
2138
|
-
|
2139
2143
|
```python
|
2140
2144
|
from puzzle_solver import thermometers_solver as solver
|
2141
2145
|
board = np.array([
|
@@ -2184,6 +2188,12 @@ status: OPTIMAL
|
|
2184
2188
|
Time taken: 0.01 seconds
|
2185
2189
|
```
|
2186
2190
|
|
2191
|
+
**Solved puzzle**
|
2192
|
+
|
2193
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/thermometers_solved.png" alt="Thermometers solved" width="500">
|
2194
|
+
|
2195
|
+
---
|
2196
|
+
|
2187
2197
|
## Aquarium (Puzzle Type #27)
|
2188
2198
|
|
2189
2199
|
* [**Play online**](https://www.puzzle-aquarium.com/)
|
@@ -2209,8 +2219,6 @@ The numbers outside the grid show the number of filled cells horizontally and ve
|
|
2209
2219
|
|
2210
2220
|
Code to utilize this package and solve the puzzle:
|
2211
2221
|
|
2212
|
-
(Note that this puzzle does not typically have a unique solution. Thus, we specify here that we only want the first valid solution that the solver finds.)
|
2213
|
-
|
2214
2222
|
```python
|
2215
2223
|
from puzzle_solver import aquarium_solver as solver
|
2216
2224
|
board = np.array([
|
@@ -2265,6 +2273,83 @@ Time taken: 0.02 seconds
|
|
2265
2273
|
|
2266
2274
|
---
|
2267
2275
|
|
2276
|
+
## Stitches (Puzzle Type #28)
|
2277
|
+
|
2278
|
+
* [**Play online**](https://www.puzzle-stitches.com/)
|
2279
|
+
|
2280
|
+
* [**Solver Code**][28]
|
2281
|
+
|
2282
|
+
<details>
|
2283
|
+
<summary><strong>Rules</strong></summary>
|
2284
|
+
|
2285
|
+
- Connect each block with ALL its neighbor blocks with exactly 1 "stitch" each.
|
2286
|
+
- A "stitch" connects 2 orthogonally adjacent cells from different blocks.
|
2287
|
+
- 2 stitches cannot share a hole.
|
2288
|
+
- The clues outside the grid indicate the number of holes on that row/column
|
2289
|
+
- For 2÷ puzzles, you have to use 2 stitches to connect neighbor blocks, for 3÷ puzzles - 3 stitches etc.
|
2290
|
+
|
2291
|
+
</details>
|
2292
|
+
|
2293
|
+
**Unsolved puzzle**
|
2294
|
+
|
2295
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/stitches_unsolved.png" alt="Stitches unsolved" width="500">
|
2296
|
+
|
2297
|
+
Code to utilize this package and solve the puzzle:
|
2298
|
+
|
2299
|
+
```python
|
2300
|
+
from puzzle_solver import stitches_solver as solver
|
2301
|
+
board = np.array([
|
2302
|
+
["00", "00", "00", "00", "00", "01", "01", "01", "01", "01", "01", "01", "01", "02", "02"],
|
2303
|
+
["00", "03", "03", "04", "00", "00", "01", "05", "05", "05", "05", "05", "01", "01", "02"],
|
2304
|
+
["00", "03", "04", "04", "04", "00", "05", "05", "05", "05", "05", "05", "05", "05", "02"],
|
2305
|
+
["00", "03", "04", "04", "04", "04", "05", "05", "06", "05", "02", "02", "02", "02", "02"],
|
2306
|
+
["07", "03", "03", "03", "03", "04", "06", "06", "06", "06", "06", "06", "06", "02", "02"],
|
2307
|
+
["07", "07", "07", "03", "03", "04", "04", "06", "08", "08", "08", "06", "02", "02", "02"],
|
2308
|
+
["07", "07", "03", "03", "03", "04", "04", "08", "08", "08", "08", "06", "06", "06", "02"],
|
2309
|
+
["07", "07", "07", "07", "07", "08", "08", "08", "09", "09", "08", "06", "08", "06", "02"],
|
2310
|
+
["10", "10", "07", "07", "09", "09", "09", "09", "09", "09", "08", "08", "08", "11", "02"],
|
2311
|
+
["10", "10", "07", "09", "09", "09", "09", "09", "09", "09", "09", "08", "08", "11", "02"],
|
2312
|
+
["10", "09", "09", "09", "12", "12", "12", "13", "09", "09", "11", "11", "11", "11", "11"],
|
2313
|
+
["10", "10", "10", "09", "12", "12", "12", "13", "09", "11", "11", "11", "13", "13", "11"],
|
2314
|
+
["14", "15", "10", "12", "12", "16", "17", "13", "13", "11", "13", "13", "13", "13", "11"],
|
2315
|
+
["14", "15", "10", "12", "16", "16", "17", "17", "13", "13", "13", "13", "13", "13", "11"],
|
2316
|
+
["14", "15", "15", "12", "16", "16", "17", "17", "17", "17", "17", "13", "13", "13", "13"]
|
2317
|
+
])
|
2318
|
+
top = np.array([6, 6, 9, 5, 3, 8, 9, 3, 1, 4, 4, 1, 4, 8, 5])
|
2319
|
+
side = np.array([0, 10, 6, 4, 4, 1, 5, 8, 2, 6, 5, 11, 4, 3, 7])
|
2320
|
+
binst = solver.Board(board=board, top=top, side=side)
|
2321
|
+
solutions = binst.solve_and_print()
|
2322
|
+
```
|
2323
|
+
**Script Output**
|
2324
|
+
|
2325
|
+
```python
|
2326
|
+
Solution found
|
2327
|
+
[[' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ']
|
2328
|
+
['R' 'L' 'D' 'R' 'L' 'R' 'L' ' ' ' ' ' ' ' ' ' ' 'D' 'R' 'L']
|
2329
|
+
[' ' ' ' 'U' ' ' ' ' 'R' 'L' ' ' ' ' ' ' ' ' ' ' 'U' 'R' 'L']
|
2330
|
+
['D' ' ' ' ' ' ' ' ' 'R' 'L' ' ' ' ' 'D' ' ' ' ' ' ' ' ' ' ']
|
2331
|
+
['U' ' ' ' ' ' ' ' ' 'R' 'L' ' ' ' ' 'U' ' ' ' ' ' ' ' ' ' ']
|
2332
|
+
[' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 'D' ' ']
|
2333
|
+
[' ' ' ' 'D' ' ' ' ' ' ' 'R' 'L' ' ' 'D' ' ' ' ' ' ' 'U' ' ']
|
2334
|
+
[' ' 'D' 'U' ' ' 'R' 'L' ' ' ' ' ' ' 'U' ' ' 'R' 'L' 'D' ' ']
|
2335
|
+
[' ' 'U' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 'U' ' ']
|
2336
|
+
[' ' ' ' 'R' 'L' ' ' ' ' ' ' ' ' ' ' ' ' 'D' ' ' 'R' 'L' 'D']
|
2337
|
+
[' ' ' ' 'D' ' ' ' ' ' ' 'R' 'L' ' ' ' ' 'U' ' ' ' ' ' ' 'U']
|
2338
|
+
['D' 'D' 'U' 'R' 'L' 'D' 'D' 'R' 'L' ' ' ' ' ' ' ' ' 'R' 'L']
|
2339
|
+
['U' 'U' ' ' ' ' ' ' 'U' 'U' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ']
|
2340
|
+
[' ' ' ' 'R' 'L' ' ' ' ' ' ' ' ' ' ' ' ' 'D' ' ' ' ' ' ' ' ']
|
2341
|
+
['R' 'L' 'R' 'L' ' ' 'R' 'L' ' ' ' ' ' ' 'U' ' ' ' ' ' ' ' ']]
|
2342
|
+
Solutions found: 1
|
2343
|
+
status: OPTIMAL
|
2344
|
+
Time taken: 0.01 seconds
|
2345
|
+
```
|
2346
|
+
|
2347
|
+
**Solved puzzle**
|
2348
|
+
|
2349
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/stitches_solved.png" alt="Stitches solved" width="500">
|
2350
|
+
|
2351
|
+
---
|
2352
|
+
|
2268
2353
|
---
|
2269
2354
|
|
2270
2355
|
## Why SAT / CP-SAT?
|
@@ -2343,3 +2428,4 @@ Issues and PRs welcome!
|
|
2343
2428
|
[25]: https://github.com/Ar-Kareem/puzzle_solver/tree/master/src/puzzle_solver/puzzles/chess_range#chess-melee-puzzle-type-25 "puzzle_solver/src/puzzle_solver/puzzles/chess_range at master · Ar-Kareem/puzzle_solver · GitHub"
|
2344
2429
|
[26]: https://github.com/Ar-Kareem/puzzle_solver/tree/master/src/puzzle_solver/puzzles/thermometers "puzzle_solver/src/puzzle_solver/puzzles/thermometers at master · Ar-Kareem/puzzle_solver · GitHub"
|
2345
2430
|
[27]: https://github.com/Ar-Kareem/puzzle_solver/tree/master/src/puzzle_solver/puzzles/aquarium "puzzle_solver/src/puzzle_solver/puzzles/aquarium at master · Ar-Kareem/puzzle_solver · GitHub"
|
2431
|
+
[28]: https://github.com/Ar-Kareem/puzzle_solver/tree/master/src/puzzle_solver/puzzles/stitches "puzzle_solver/src/puzzle_solver/puzzles/stitches at master · Ar-Kareem/puzzle_solver · GitHub"
|