multi-puzzle-solver 0.9.20__tar.gz → 0.9.24__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.

Files changed (104) hide show
  1. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/PKG-INFO +341 -3
  2. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/README.md +340 -2
  3. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/multi_puzzle_solver.egg-info/PKG-INFO +341 -3
  4. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/multi_puzzle_solver.egg-info/SOURCES.txt +8 -1
  5. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/puzzle_solver/__init__.py +4 -1
  6. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/puzzle_solver/core/utils.py +135 -0
  7. multi_puzzle_solver-0.9.24/src/puzzle_solver/puzzles/binairo/binairo.py +98 -0
  8. multi_puzzle_solver-0.9.24/src/puzzle_solver/puzzles/rectangles/rectangles.py +130 -0
  9. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/puzzle_solver/puzzles/slitherlink/slitherlink.py +4 -128
  10. multi_puzzle_solver-0.9.24/src/puzzle_solver/puzzles/sudoku/sudoku.py +203 -0
  11. multi_puzzle_solver-0.9.24/src/puzzle_solver/puzzles/yin_yang/parse_map/parse_map.py +172 -0
  12. multi_puzzle_solver-0.9.24/src/puzzle_solver/puzzles/yin_yang/yin_yang.py +110 -0
  13. multi_puzzle_solver-0.9.24/tests/test_binairo.py +126 -0
  14. multi_puzzle_solver-0.9.24/tests/test_rectangles.py +127 -0
  15. multi_puzzle_solver-0.9.24/tests/test_sudoku.py +176 -0
  16. multi_puzzle_solver-0.9.24/tests/test_yin_yang.py +176 -0
  17. multi_puzzle_solver-0.9.20/src/puzzle_solver/puzzles/sudoku/sudoku.py +0 -90
  18. multi_puzzle_solver-0.9.20/tests/test_sudoku.py +0 -59
  19. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/pyproject.toml +0 -0
  20. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/setup.cfg +0 -0
  21. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/multi_puzzle_solver.egg-info/dependency_links.txt +0 -0
  22. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/multi_puzzle_solver.egg-info/requires.txt +0 -0
  23. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/multi_puzzle_solver.egg-info/top_level.txt +0 -0
  24. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/puzzle_solver/core/utils_ortools.py +0 -0
  25. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/puzzle_solver/puzzles/aquarium/aquarium.py +0 -0
  26. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/puzzle_solver/puzzles/battleships/battleships.py +0 -0
  27. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/puzzle_solver/puzzles/black_box/black_box.py +0 -0
  28. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/puzzle_solver/puzzles/bridges/bridges.py +0 -0
  29. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/puzzle_solver/puzzles/chess_range/chess_melee.py +0 -0
  30. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/puzzle_solver/puzzles/chess_range/chess_range.py +0 -0
  31. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/puzzle_solver/puzzles/chess_range/chess_solo.py +0 -0
  32. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/puzzle_solver/puzzles/dominosa/dominosa.py +0 -0
  33. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/puzzle_solver/puzzles/filling/filling.py +0 -0
  34. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/puzzle_solver/puzzles/galaxies/galaxies.py +0 -0
  35. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/puzzle_solver/puzzles/galaxies/parse_map/parse_map.py +0 -0
  36. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/puzzle_solver/puzzles/guess/guess.py +0 -0
  37. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/puzzle_solver/puzzles/inertia/inertia.py +0 -0
  38. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/puzzle_solver/puzzles/inertia/parse_map/parse_map.py +0 -0
  39. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/puzzle_solver/puzzles/inertia/tsp.py +0 -0
  40. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/puzzle_solver/puzzles/kakurasu/kakurasu.py +0 -0
  41. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/puzzle_solver/puzzles/keen/keen.py +0 -0
  42. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/puzzle_solver/puzzles/light_up/light_up.py +0 -0
  43. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/puzzle_solver/puzzles/lits/lits.py +0 -0
  44. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/puzzle_solver/puzzles/magnets/magnets.py +0 -0
  45. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/puzzle_solver/puzzles/map/map.py +0 -0
  46. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/puzzle_solver/puzzles/minesweeper/minesweeper.py +0 -0
  47. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/puzzle_solver/puzzles/mosaic/mosaic.py +0 -0
  48. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/puzzle_solver/puzzles/nonograms/nonograms.py +0 -0
  49. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/puzzle_solver/puzzles/norinori/norinori.py +0 -0
  50. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/puzzle_solver/puzzles/pearl/pearl.py +0 -0
  51. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/puzzle_solver/puzzles/range/range.py +0 -0
  52. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/puzzle_solver/puzzles/signpost/signpost.py +0 -0
  53. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/puzzle_solver/puzzles/singles/singles.py +0 -0
  54. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/puzzle_solver/puzzles/slant/parse_map/parse_map.py +0 -0
  55. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/puzzle_solver/puzzles/slant/slant.py +0 -0
  56. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/puzzle_solver/puzzles/star_battle/star_battle.py +0 -0
  57. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/puzzle_solver/puzzles/star_battle/star_battle_shapeless.py +0 -0
  58. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/puzzle_solver/puzzles/stitches/parse_map/parse_map.py +0 -0
  59. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/puzzle_solver/puzzles/stitches/stitches.py +0 -0
  60. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/puzzle_solver/puzzles/tents/tents.py +0 -0
  61. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/puzzle_solver/puzzles/thermometers/thermometers.py +0 -0
  62. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/puzzle_solver/puzzles/towers/towers.py +0 -0
  63. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/puzzle_solver/puzzles/tracks/tracks.py +0 -0
  64. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/puzzle_solver/puzzles/undead/undead.py +0 -0
  65. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/puzzle_solver/puzzles/unequal/unequal.py +0 -0
  66. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/puzzle_solver/puzzles/unruly/unruly.py +0 -0
  67. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/src/puzzle_solver/utils/visualizer.py +0 -0
  68. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/tests/test_aquarium.py +0 -0
  69. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/tests/test_battleships.py +0 -0
  70. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/tests/test_black_box.py +0 -0
  71. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/tests/test_bridges.py +0 -0
  72. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/tests/test_chess_melee.py +0 -0
  73. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/tests/test_chess_range.py +0 -0
  74. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/tests/test_chess_solo.py +0 -0
  75. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/tests/test_dominosa.py +0 -0
  76. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/tests/test_filling.py +0 -0
  77. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/tests/test_galaxies.py +0 -0
  78. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/tests/test_guess.py +0 -0
  79. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/tests/test_inertia.py +0 -0
  80. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/tests/test_kakurasu.py +0 -0
  81. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/tests/test_keen.py +0 -0
  82. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/tests/test_light_up.py +0 -0
  83. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/tests/test_lits.py +0 -0
  84. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/tests/test_magnets.py +0 -0
  85. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/tests/test_map.py +0 -0
  86. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/tests/test_minesweeper.py +0 -0
  87. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/tests/test_mosaic.py +0 -0
  88. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/tests/test_nonograms.py +0 -0
  89. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/tests/test_norinori.py +0 -0
  90. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/tests/test_pearl.py +0 -0
  91. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/tests/test_range.py +0 -0
  92. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/tests/test_signpost.py +0 -0
  93. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/tests/test_singles.py +0 -0
  94. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/tests/test_slant.py +0 -0
  95. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/tests/test_slitherlink.py +0 -0
  96. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/tests/test_star_battle.py +0 -0
  97. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/tests/test_stitches.py +0 -0
  98. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/tests/test_tents.py +0 -0
  99. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/tests/test_thermometers.py +0 -0
  100. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/tests/test_towers.py +0 -0
  101. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/tests/test_tracks.py +0 -0
  102. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/tests/test_undead.py +0 -0
  103. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/tests/test_unequal.py +0 -0
  104. {multi_puzzle_solver-0.9.20 → multi_puzzle_solver-0.9.24}/tests/test_unruly.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: multi-puzzle-solver
3
- Version: 0.9.20
3
+ Version: 0.9.24
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
@@ -309,6 +309,23 @@ These are all the puzzles that are implemented in this repo. <br> Click on any o
309
309
  <img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/slitherlink_solved.png" alt="Slitherlink" width="140">
310
310
  </a>
311
311
  </td>
312
+ <td align="center">
313
+ <a href="#yin-yang-puzzle-type-40"><b>Yin-Yang</b><br><br>
314
+ <img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/yin_yang_solved.png" alt="Yin-Yang" width="140">
315
+ </a>
316
+ </td>
317
+ </tr>
318
+ <tr>
319
+ <td align="center">
320
+ <a href="#binairo-puzzle-type-41"><b>Binairo</b><br><br>
321
+ <img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/binairo_solved.png" alt="Binairo" width="140">
322
+ </a>
323
+ </td>
324
+ <td align="center">
325
+ <a href="#rectangles-puzzle-type-42"><b>Rectangles</b><br><br>
326
+ <img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/rectangles_solved.png" alt="Rectangles" width="140">
327
+ </a>
328
+ </td>
312
329
  </tr>
313
330
  </table>
314
331
 
@@ -363,6 +380,9 @@ These are all the puzzles that are implemented in this repo. <br> Click on any o
363
380
  - [Unequal (Puzzle Type #37)](#unequal-puzzle-type-37)
364
381
  - [Norinori (Puzzle Type #38)](#norinori-puzzle-type-38)
365
382
  - [Slitherlink (Puzzle Type #39)](#slitherlink-puzzle-type-39)
383
+ - [Yin-Yang (Puzzle Type #40)](#yin-yang-puzzle-type-40)
384
+ - [Binairo (Puzzle Type #41)](#binairo-puzzle-type-41)
385
+ - [Rectangles (Puzzle Type #42)](#rectangles-puzzle-type-42)
366
386
  - [Why SAT / CP-SAT?](#why-sat--cp-sat)
367
387
  - [Testing](#testing)
368
388
  - [Contributing](#contributing)
@@ -488,6 +508,13 @@ You are given some of the numbers as clues; your aim is to place the rest of the
488
508
  <img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/sudoku_unsolved.png" alt="Sudoku unsolved" width="500">
489
509
 
490
510
  Code to utilize this package and solve the puzzle:
511
+
512
+ Note:
513
+
514
+ - The solver also supports solving the ["Sandwich" sudoku variant](https://dkmgames.com/SandwichSudoku/) through the optional parameter ``sandwich={'side': [...], 'bottom': [...] }``。
515
+
516
+ - The solver also supports solving the ["Sudoku-X" variant](https://www.sudopedia.org/wiki/Sudoku-X) through the optional parameter ``unique_diagonal=True``。
517
+
491
518
  ```python
492
519
  import numpy as np
493
520
  from puzzle_solver import sudoku_solver as solver
@@ -2220,6 +2247,7 @@ The numbers outside the grid show the number of filled cells horizontally and ve
2220
2247
  Code to utilize this package and solve the puzzle:
2221
2248
 
2222
2249
  ```python
2250
+ import numpy as np
2223
2251
  from puzzle_solver import thermometers_solver as solver
2224
2252
  board = np.array([
2225
2253
  ['R', 'R', 'D', 'R', 'D', 'R', 'X', 'D', 'L', 'X', 'L', 'L', 'L', 'L', 'L'],
@@ -2299,6 +2327,7 @@ The numbers outside the grid show the number of filled cells horizontally and ve
2299
2327
  Code to utilize this package and solve the puzzle:
2300
2328
 
2301
2329
  ```python
2330
+ import numpy as np
2302
2331
  from puzzle_solver import aquarium_solver as solver
2303
2332
  board = np.array([
2304
2333
  ['01', '01', '01', '01', '02', '02', '02', '03', '03', '03', '03', '04', '05', '05', '05'],
@@ -2376,6 +2405,7 @@ Time taken: 0.02 seconds
2376
2405
  Code to utilize this package and solve the puzzle:
2377
2406
 
2378
2407
  ```python
2408
+ import numpy as np
2379
2409
  from puzzle_solver import stitches_solver as solver
2380
2410
  board = np.array([
2381
2411
  ["00", "00", "00", "00", "00", "01", "01", "01", "01", "01", "01", "01", "01", "02", "02"],
@@ -2456,6 +2486,7 @@ Time taken: 0.01 seconds
2456
2486
  Code to utilize this package and solve the puzzle:
2457
2487
 
2458
2488
  ```python
2489
+ import numpy as np
2459
2490
  from puzzle_solver import battleships_solver as solver
2460
2491
  board = np.array([
2461
2492
  [' ', ' ', ' ', ' ', ' ', 'S', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
@@ -2538,6 +2569,7 @@ The goal is to make some of the cells black in such a way that:
2538
2569
  Code to utilize this package and solve the puzzle:
2539
2570
 
2540
2571
  ```python
2572
+ import numpy as np
2541
2573
  from puzzle_solver import kakurasu_solver as solver
2542
2574
  side = np.array([27, 6, 1, 12, 37, 37, 11, 4, 29, 23, 66, 55])
2543
2575
  bottom = np.array([22, 1, 25, 36, 10, 22, 25, 35, 32, 28, 45, 45])
@@ -2598,6 +2630,7 @@ Code to utilize this package and solve the puzzle:
2598
2630
  Note that as usual the board is an id of the shape (id is meaningless, just used to identify one shape), and the `star_count` parameter depenends on the puzzle type.
2599
2631
 
2600
2632
  ```python
2633
+ import numpy as np
2601
2634
  from puzzle_solver import star_battle_solver as solver
2602
2635
  board = np.array([
2603
2636
  ['00', '00', '00', '00', '00', '01', '01', '01', '01', '01', '01', '01', '01', '01', '02', '02', '02', '03', '03', '03', '03', '03', '03', '03', '03'],
@@ -2697,7 +2730,8 @@ Code to utilize this package and solve the puzzle:
2697
2730
  The `star_count` parameter depenends on the puzzle type.
2698
2731
 
2699
2732
  ```python
2700
- from puzzle_solver import star_battle_shapeless_solver as shapeless_solver
2733
+ import numpy as np
2734
+ from puzzle_solver import star_battle_shapeless as solver
2701
2735
  board = np.array([
2702
2736
  [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
2703
2737
  ['B', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
@@ -2710,7 +2744,7 @@ board = np.array([
2710
2744
  ['B', 'B', ' ', ' ', ' ', ' ', 'B', 'B', 'B', ' '],
2711
2745
  ['B', ' ', ' ', ' ', 'B', ' ', ' ', ' ', ' ', ' '],
2712
2746
  ])
2713
- binst = shapeless_solver.Board(board=board, star_count=2)
2747
+ binst = solver.Board(board=board, star_count=2)
2714
2748
  solutions = binst.solve_and_print()
2715
2749
  ```
2716
2750
 
@@ -2767,6 +2801,8 @@ Note: The solver is capable of solving variations where the puzzle pieces the ma
2767
2801
  Code to utilize this package and solve the puzzle:
2768
2802
 
2769
2803
  ```python
2804
+ import numpy as np
2805
+ from puzzle_solver import lits_solver as solver
2770
2806
  board = np.array([
2771
2807
  ['00', '00', '00', '01', '01', '02', '02', '02', '03', '03', '03', '04', '04', '05', '06', '07', '07', '08', '08', '09'],
2772
2808
  ['00', '00', '00', '00', '01', '02', '03', '03', '03', '10', '04', '04', '05', '05', '06', '07', '08', '08', '09', '09'],
@@ -2963,6 +2999,7 @@ Code to utilize this package and solve the puzzle:
2963
2999
  Note: The number are arbitrary and simply number each galaxy as an integer.
2964
3000
 
2965
3001
  ```python
3002
+ import numpy as np
2966
3003
  from puzzle_solver import galaxies_solver as solver
2967
3004
  galaxies = np.array([
2968
3005
  [' ', ' ', '00', ' ', ' ', '01', '01', '02', '02', '03', '03', ' ', '04', '04', ' '],
@@ -3047,6 +3084,7 @@ Code to utilize this package and solve the puzzle:
3047
3084
  Note: For an NxM board you need an (N+1)x(M+1) array because the puzzle is to solve for the cells while the input is the values at the corners (there's always one more corner than cells in each dimension).
3048
3085
 
3049
3086
  ```python
3087
+ import numpy as np
3050
3088
  from puzzle_solver import slant_solver as solver
3051
3089
  board = np.array([
3052
3090
  [' ', ' ', '1', ' ', '1', ' ', '1', ' ', '1', ' ', ' ', ' ', ' '],
@@ -3131,6 +3169,7 @@ Code to utilize this package and solve the puzzle:
3131
3169
  Note: For an NxM board you need an (2N-1)x(2M-1) array because the puzzle involves input in between the cells. Each numbered cell has neighbors horizontally to represent ">", "<", and "|" (where "|" represents adjacency) and vertically to represent "∧", "∨" and "-" (where "-" represents adjacency). The "X" in the input are unused corners that shouldnt contain anything (just a corner). The numbers should never appear orthogonal to an "X", only diagonally to it. vice-versa for the comparison operators.
3132
3170
 
3133
3171
  ```python
3172
+ import numpy as np
3134
3173
  from puzzle_solver import unequal_solver as solver
3135
3174
  board = np.array([
3136
3175
  [' ', ' ', ' ', ' ', '9', ' ', '1', ' ', '7', '>', ' ', '>', ' ', ' ', ' ', ' ', ' ', '>', ' '],
@@ -3210,6 +3249,7 @@ You have to shade some of the cells in such a way that:
3210
3249
  Code to utilize this package and solve the puzzle:
3211
3250
 
3212
3251
  ```python
3252
+ import numpy as np
3213
3253
  from puzzle_solver import norinori_solver as solver
3214
3254
  board = np.array([
3215
3255
  ['00', '01', '01', '01', '01', '02', '03', '03', '04', '04', '04', '05', '05', '05', '06', '07', '08', '08', '09', '09'],
@@ -3299,6 +3339,7 @@ A line forming a single loop without crossings or branches means that every corn
3299
3339
  Code to utilize this package and solve the puzzle:
3300
3340
 
3301
3341
  ```python
3342
+ import numpy as np
3302
3343
  from puzzle_solver import slitherlink_solver as solver
3303
3344
  board = np.array([
3304
3345
  ['3', ' ', ' ', '2', ' ', ' ', ' ', ' ', ' ', '3', ' ', ' ', ' ', ' ', ' ', '3', ' ', ' ', '1', ' '],
@@ -3385,6 +3426,300 @@ Applying the solution to the puzzle visually:
3385
3426
 
3386
3427
  ---
3387
3428
 
3429
+ ## Yin-Yang (Puzzle Type #40)
3430
+
3431
+ * [**Play online**](https://www.puzzle-yin-yang.com)
3432
+
3433
+ * [**Solver Code**][40]
3434
+
3435
+ <details>
3436
+ <summary><strong>Rules</strong></summary>
3437
+
3438
+ Yin-Yang is played on a rectangular grid with no standard size. Some cells start out filled with black or white. The rest of the cells are empty. The goal is to color all cells in such a way that:
3439
+ 1. All black cells should be connected orthogonally in a single group.
3440
+ 2. All white cells should be connected orthogonally in a single group.
3441
+ 3. 2x2 areas of the same color are not allowed.
3442
+
3443
+ </details>
3444
+
3445
+ **Unsolved puzzle**
3446
+
3447
+ <img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/yin_yang_unsolved.png" alt="Yin-Yang unsolved" width="500">
3448
+
3449
+ Code to utilize this package and solve the puzzle:
3450
+
3451
+ ```python
3452
+ import numpy as np
3453
+ from puzzle_solver import yin_yang_solver as solver
3454
+ board = np.array([
3455
+ [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
3456
+ [' ', ' ', ' ', ' ', ' ', 'W', ' ', ' ', ' ', 'B', ' ', ' ', 'W', ' ', 'W', ' ', ' ', 'W', ' ', ' '],
3457
+ [' ', ' ', 'B', ' ', 'B', ' ', 'W', ' ', ' ', 'W', 'B', ' ', ' ', ' ', ' ', 'W', ' ', 'W', ' ', ' '],
3458
+ [' ', ' ', ' ', ' ', ' ', 'W', ' ', 'W', ' ', 'B', ' ', ' ', ' ', ' ', 'W', ' ', ' ', 'W', ' ', ' '],
3459
+ [' ', 'W', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'W', 'W', ' ', ' ', ' ', ' ', ' ', ' ', 'W', ' ', ' '],
3460
+ [' ', ' ', ' ', ' ', 'W', ' ', ' ', ' ', 'W', 'B', ' ', ' ', ' ', ' ', ' ', 'W', ' ', 'W', ' ', ' '],
3461
+ [' ', ' ', ' ', ' ', ' ', 'W', ' ', ' ', ' ', ' ', 'B', ' ', 'B', ' ', 'B', 'W', ' ', 'W', ' ', ' '],
3462
+ [' ', ' ', 'B', 'W', 'W', ' ', 'W', ' ', ' ', ' ', 'B', ' ', 'B', ' ', 'B', ' ', ' ', ' ', ' ', ' '],
3463
+ [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'B', ' ', 'B', ' ', 'B', ' ', 'B', ' ', 'B', ' ', 'B', ' '],
3464
+ [' ', 'W', ' ', 'W', ' ', ' ', 'W', ' ', ' ', ' ', 'B', ' ', 'B', ' ', 'B', ' ', 'B', ' ', 'B', ' '],
3465
+ [' ', ' ', ' ', ' ', 'W', 'B', ' ', ' ', ' ', 'B', ' ', ' ', 'B', ' ', 'B', ' ', 'B', ' ', 'B', ' '],
3466
+ [' ', ' ', 'B', ' ', ' ', ' ', 'B', 'B', ' ', 'W', 'B', ' ', 'B', ' ', 'B', ' ', ' ', 'B', ' ', ' '],
3467
+ [' ', 'W', 'W', 'W', ' ', 'B', ' ', 'W', ' ', ' ', 'B', ' ', 'B', ' ', 'B', ' ', ' ', ' ', 'B', ' '],
3468
+ [' ', ' ', ' ', ' ', ' ', ' ', 'W', ' ', ' ', 'B', ' ', 'B', ' ', ' ', 'B', ' ', 'B', ' ', 'B', ' '],
3469
+ [' ', 'W', ' ', 'B', 'W', 'B', ' ', 'W', ' ', ' ', ' ', ' ', 'B', 'B', ' ', ' ', 'B', ' ', 'B', ' '],
3470
+ [' ', ' ', ' ', ' ', 'W', ' ', ' ', 'B', 'B', 'B', 'B', 'B', ' ', ' ', ' ', 'B', ' ', ' ', 'B', ' '],
3471
+ [' ', 'W', ' ', ' ', ' ', 'W', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'B', ' ', 'B', ' '],
3472
+ ['W', ' ', ' ', 'W', ' ', ' ', 'B', ' ', ' ', 'B', 'B', 'B', 'B', 'B', ' ', ' ', 'B', ' ', 'B', ' '],
3473
+ [' ', 'W', 'W', ' ', 'W', ' ', ' ', 'B', ' ', ' ', ' ', ' ', ' ', ' ', 'B', ' ', 'B', ' ', 'B', ' '],
3474
+ ['B', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'B', 'W']
3475
+ ])
3476
+ binst = solver.Board(board=board)
3477
+ solutions = binst.solve_and_print()
3478
+ ```
3479
+
3480
+ **Script Output**
3481
+
3482
+ ```python
3483
+ Solution found
3484
+ [
3485
+ [ 'W', 'W', 'W', 'W', 'W', 'W', 'W', 'W', 'W', 'W', 'W', 'W', 'W', 'W', 'W', 'W', 'W', 'W', 'W', 'W' ],
3486
+ [ 'W', 'B', 'B', 'W', 'B', 'W', 'B', 'B', 'B', 'B', 'B', 'B', 'W', 'B', 'W', 'B', 'B', 'W', 'B', 'W' ],
3487
+ [ 'W', 'W', 'B', 'W', 'B', 'W', 'W', 'W', 'W', 'W', 'B', 'W', 'W', 'B', 'W', 'W', 'B', 'W', 'B', 'W' ],
3488
+ [ 'W', 'B', 'B', 'B', 'B', 'W', 'B', 'W', 'B', 'B', 'B', 'B', 'B', 'B', 'W', 'B', 'B', 'W', 'B', 'W' ],
3489
+ [ 'W', 'W', 'W', 'B', 'W', 'W', 'B', 'W', 'W', 'W', 'W', 'W', 'B', 'W', 'W', 'W', 'B', 'W', 'B', 'W' ],
3490
+ [ 'W', 'B', 'W', 'B', 'W', 'B', 'B', 'B', 'W', 'B', 'B', 'W', 'B', 'W', 'B', 'W', 'B', 'W', 'B', 'W' ],
3491
+ [ 'W', 'B', 'B', 'B', 'W', 'W', 'W', 'B', 'W', 'W', 'B', 'W', 'B', 'W', 'B', 'W', 'B', 'W', 'B', 'W' ],
3492
+ [ 'W', 'W', 'B', 'W', 'W', 'B', 'W', 'B', 'B', 'W', 'B', 'W', 'B', 'W', 'B', 'W', 'B', 'W', 'B', 'W' ],
3493
+ [ 'W', 'B', 'B', 'B', 'B', 'B', 'W', 'W', 'B', 'W', 'B', 'W', 'B', 'W', 'B', 'W', 'B', 'W', 'B', 'W' ],
3494
+ [ 'W', 'W', 'W', 'W', 'W', 'B', 'W', 'B', 'B', 'W', 'B', 'W', 'B', 'W', 'B', 'W', 'B', 'W', 'B', 'W' ],
3495
+ [ 'W', 'B', 'W', 'B', 'W', 'B', 'W', 'W', 'B', 'B', 'B', 'W', 'B', 'W', 'B', 'W', 'B', 'W', 'B', 'W' ],
3496
+ [ 'W', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'W', 'B', 'W', 'B', 'W', 'B', 'W', 'B', 'B', 'B', 'W' ],
3497
+ [ 'W', 'W', 'W', 'W', 'W', 'B', 'W', 'W', 'W', 'W', 'B', 'W', 'B', 'W', 'B', 'W', 'W', 'W', 'B', 'W' ],
3498
+ [ 'W', 'B', 'B', 'B', 'B', 'B', 'W', 'B', 'B', 'B', 'B', 'B', 'B', 'W', 'B', 'W', 'B', 'W', 'B', 'W' ],
3499
+ [ 'W', 'W', 'W', 'B', 'W', 'B', 'W', 'W', 'W', 'W', 'W', 'W', 'B', 'B', 'B', 'W', 'B', 'W', 'B', 'W' ],
3500
+ [ 'W', 'B', 'B', 'B', 'W', 'B', 'W', 'B', 'B', 'B', 'B', 'B', 'B', 'W', 'B', 'B', 'B', 'W', 'B', 'W' ],
3501
+ [ 'W', 'W', 'B', 'W', 'W', 'W', 'W', 'W', 'W', 'W', 'W', 'W', 'W', 'W', 'W', 'W', 'B', 'W', 'B', 'W' ],
3502
+ [ 'W', 'B', 'B', 'W', 'B', 'B', 'B', 'B', 'W', 'B', 'B', 'B', 'B', 'B', 'B', 'W', 'B', 'W', 'B', 'W' ],
3503
+ [ 'W', 'W', 'W', 'W', 'W', 'W', 'W', 'B', 'W', 'W', 'W', 'W', 'W', 'W', 'B', 'W', 'B', 'W', 'B', 'W' ],
3504
+ [ 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'W' ],
3505
+ ]
3506
+ Solutions found: 1
3507
+ status: OPTIMAL
3508
+ Time taken: 3.10 seconds
3509
+ ```
3510
+
3511
+ **Solved puzzle**
3512
+
3513
+ Applying the solution to the puzzle visually:
3514
+
3515
+ <img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/yin_yang_solved.png" alt="Yin-Yang solved" width="500">
3516
+
3517
+ ---
3518
+
3519
+ ## Binairo (Puzzle Type #41)
3520
+
3521
+ * [**Play online**](https://www.puzzle-binairo.com)
3522
+
3523
+ * [**Solver Code**][41]
3524
+
3525
+ <details>
3526
+ <summary><strong>Rules</strong></summary>
3527
+
3528
+ Binairo is played on a rectangular grid with no standard size. Some cells start out filled with black or white circles. The rest of the cells are empty. The goal is to place circles in all cells in such a way that:
3529
+
3530
+ 1. Each row and each column must contain an equal number of white and black circles.
3531
+ 2. More than two circles of the same color can't be adjacent.
3532
+ 3. Each row and column is unique.
3533
+
3534
+ </details>
3535
+
3536
+ **Unsolved puzzle**
3537
+
3538
+ <img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/binairo_unsolved.png" alt="Binairo unsolved" width="500">
3539
+
3540
+ Code to utilize this package and solve the puzzle:
3541
+
3542
+ ```python
3543
+ import numpy as np
3544
+ from puzzle_solver import binairo_solver as solver
3545
+ board = np.array([
3546
+ [' ', ' ', ' ', ' ', 'W', ' ', ' ', ' ', 'W', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'B', ' ', ' ', 'W'],
3547
+ [' ', 'W', ' ', ' ', 'B', ' ', ' ', ' ', ' ', ' ', ' ', 'W', ' ', ' ', 'B', ' ', ' ', ' ', 'B', ' '],
3548
+ [' ', 'W', ' ', ' ', ' ', 'W', ' ', 'W', 'W', ' ', ' ', ' ', 'B', ' ', ' ', 'W', ' ', ' ', ' ', ' '],
3549
+ ['B', ' ', ' ', 'W', ' ', ' ', 'B', ' ', ' ', ' ', ' ', ' ', 'B', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
3550
+ ['B', ' ', ' ', ' ', 'W', ' ', ' ', ' ', ' ', 'B', ' ', 'W', ' ', ' ', ' ', 'B', ' ', ' ', ' ', 'W'],
3551
+ [' ', ' ', 'W', ' ', ' ', 'W', ' ', ' ', ' ', ' ', 'W', ' ', ' ', ' ', ' ', ' ', ' ', 'W', ' ', ' '],
3552
+ ['W', ' ', ' ', ' ', ' ', ' ', 'B', ' ', ' ', 'B', ' ', ' ', 'B', 'B', ' ', ' ', 'W', ' ', 'B', ' '],
3553
+ [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'B', ' ', ' ', ' ', ' ', ' ', 'W', ' ', ' ', ' '],
3554
+ [' ', ' ', ' ', ' ', 'W', ' ', 'B', ' ', 'W', ' ', ' ', ' ', 'B', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
3555
+ [' ', 'W', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'W', ' ', ' ', ' ', 'W', 'W', ' ', ' ', ' '],
3556
+ [' ', ' ', 'B', ' ', ' ', ' ', 'B', ' ', 'B', ' ', ' ', ' ', 'B', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
3557
+ [' ', 'W', 'B', ' ', 'W', ' ', 'B', ' ', ' ', ' ', ' ', ' ', 'W', 'W', ' ', 'B', ' ', ' ', 'B', ' '],
3558
+ [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'B', ' ', ' ', ' ', 'B', 'B'],
3559
+ [' ', 'B', ' ', ' ', ' ', ' ', 'W', ' ', 'W', 'W', ' ', ' ', 'W', ' ', ' ', ' ', 'W', ' ', ' ', ' '],
3560
+ [' ', ' ', 'W', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'W', 'W', ' ', ' ', 'W', 'W', ' '],
3561
+ [' ', 'B', ' ', 'B', 'W', ' ', ' ', ' ', ' ', ' ', ' ', 'B', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
3562
+ [' ', 'B', ' ', ' ', ' ', 'W', ' ', ' ', ' ', 'W', ' ', ' ', 'B', ' ', 'B', ' ', ' ', ' ', ' ', ' '],
3563
+ [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'B', ' ', ' ', ' ', ' ', ' ', ' ', 'W', ' ', ' ', ' ', 'W'],
3564
+ [' ', ' ', ' ', 'B', 'B', ' ', ' ', 'W', ' ', 'W', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'B', ' ', ' '],
3565
+ ['B', ' ', 'B', 'B', ' ', ' ', ' ', ' ', ' ', 'W', ' ', 'B', ' ', ' ', 'B', ' ', ' ', ' ', ' ', ' ']
3566
+ ])
3567
+ binst = solver.Board(board=board)
3568
+ solutions = binst.solve_and_print()
3569
+ ```
3570
+
3571
+ **Script Output**
3572
+
3573
+ ```python
3574
+ Solution found
3575
+ [
3576
+ [ 'B', 'B', 'W', 'B', 'W', 'B', 'W', 'B', 'W', 'W', 'B', 'W', 'W', 'B', 'W', 'B', 'B', 'W', 'B', 'W' ],
3577
+ [ 'W', 'W', 'B', 'W', 'B', 'B', 'W', 'B', 'B', 'W', 'B', 'W', 'W', 'B', 'B', 'W', 'W', 'B', 'B', 'W' ],
3578
+ [ 'W', 'W', 'B', 'B', 'W', 'W', 'B', 'W', 'W', 'B', 'W', 'B', 'B', 'W', 'B', 'W', 'B', 'B', 'W', 'B' ],
3579
+ [ 'B', 'B', 'W', 'W', 'B', 'W', 'B', 'W', 'B', 'W', 'W', 'B', 'B', 'W', 'W', 'B', 'W', 'W', 'B', 'B' ],
3580
+ [ 'B', 'W', 'B', 'W', 'W', 'B', 'W', 'B', 'W', 'B', 'B', 'W', 'W', 'B', 'W', 'B', 'W', 'B', 'B', 'W' ],
3581
+ [ 'W', 'B', 'W', 'B', 'B', 'W', 'W', 'B', 'B', 'W', 'W', 'B', 'B', 'W', 'B', 'W', 'B', 'W', 'W', 'B' ],
3582
+ [ 'W', 'B', 'W', 'W', 'B', 'W', 'B', 'W', 'W', 'B', 'B', 'W', 'B', 'B', 'W', 'B', 'W', 'B', 'B', 'W' ],
3583
+ [ 'B', 'W', 'B', 'W', 'W', 'B', 'W', 'B', 'B', 'W', 'B', 'B', 'W', 'W', 'B', 'W', 'W', 'B', 'W', 'B' ],
3584
+ [ 'W', 'B', 'W', 'B', 'W', 'B', 'B', 'W', 'W', 'B', 'W', 'B', 'B', 'W', 'W', 'B', 'B', 'W', 'B', 'W' ],
3585
+ [ 'B', 'W', 'W', 'B', 'B', 'W', 'W', 'B', 'W', 'B', 'B', 'W', 'W', 'B', 'B', 'W', 'W', 'B', 'W', 'B' ],
3586
+ [ 'W', 'B', 'B', 'W', 'B', 'W', 'B', 'W', 'B', 'W', 'B', 'W', 'B', 'B', 'W', 'W', 'B', 'B', 'W', 'W' ],
3587
+ [ 'B', 'W', 'B', 'W', 'W', 'B', 'B', 'W', 'B', 'B', 'W', 'B', 'W', 'W', 'B', 'B', 'W', 'W', 'B', 'W' ],
3588
+ [ 'B', 'W', 'W', 'B', 'B', 'W', 'W', 'B', 'W', 'B', 'W', 'W', 'B', 'W', 'B', 'W', 'B', 'W', 'B', 'B' ],
3589
+ [ 'W', 'B', 'B', 'W', 'B', 'B', 'W', 'B', 'W', 'W', 'B', 'B', 'W', 'B', 'W', 'B', 'W', 'B', 'W', 'W' ],
3590
+ [ 'B', 'W', 'W', 'B', 'W', 'B', 'B', 'W', 'B', 'B', 'W', 'W', 'B', 'W', 'W', 'B', 'B', 'W', 'W', 'B' ],
3591
+ [ 'W', 'B', 'W', 'B', 'W', 'W', 'B', 'W', 'B', 'B', 'W', 'B', 'W', 'B', 'B', 'W', 'B', 'W', 'B', 'W' ],
3592
+ [ 'W', 'B', 'B', 'W', 'B', 'W', 'W', 'B', 'W', 'W', 'B', 'W', 'B', 'W', 'B', 'B', 'W', 'B', 'W', 'B' ],
3593
+ [ 'B', 'W', 'B', 'W', 'W', 'B', 'B', 'W', 'B', 'B', 'W', 'W', 'B', 'B', 'W', 'W', 'B', 'W', 'B', 'W' ],
3594
+ [ 'W', 'B', 'W', 'B', 'B', 'W', 'B', 'W', 'B', 'W', 'W', 'B', 'W', 'B', 'W', 'B', 'W', 'B', 'W', 'B' ],
3595
+ [ 'B', 'W', 'B', 'B', 'W', 'B', 'W', 'B', 'W', 'W', 'B', 'B', 'W', 'W', 'B', 'W', 'B', 'W', 'W', 'B' ],
3596
+ ]
3597
+ Solutions found: 1
3598
+ status: OPTIMAL
3599
+ Time taken: 0.03 seconds
3600
+ ```
3601
+
3602
+ **Solved puzzle**
3603
+
3604
+ Applying the solution to the puzzle visually:
3605
+
3606
+ <img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/binairo_solved.png" alt="Binairo solved" width="500">
3607
+
3608
+ ---
3609
+
3610
+ ## Rectangles (Puzzle Type #42)
3611
+
3612
+ Also called "Shikaku".
3613
+
3614
+ * [**Play online**](https://www.chiark.greenend.org.uk/~sgtatham/puzzles/js/rect.html)
3615
+
3616
+ * [**Instructions**](https://www.chiark.greenend.org.uk/~sgtatham/puzzles/doc/rect.html#rect)
3617
+
3618
+ * [**Solver Code**][42]
3619
+
3620
+ <details>
3621
+ <summary><strong>Rules</strong></summary>
3622
+
3623
+ You have a grid of squares, with numbers written in some (but not all) of the squares. Your task is to subdivide the grid into rectangles of various sizes, such that both:
3624
+
3625
+ - (a) every rectangle contains exactly one numbered square
3626
+ - (b) the area of each rectangle is equal to the number written in its numbered square.
3627
+
3628
+
3629
+ </details>
3630
+
3631
+ **Unsolved puzzle**
3632
+
3633
+ <img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/rectangles_unsolved.png" alt="Rectangles unsolved" width="500">
3634
+
3635
+ Code to utilize this package and solve the puzzle:
3636
+
3637
+ ```python
3638
+ import numpy as np
3639
+ from puzzle_solver import rectangles_solver as solver
3640
+ board = np.array([
3641
+ ['3', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '15',' ', ' ', ' ', ' ' ],
3642
+ [' ', ' ', '2', '2', ' ', ' ', ' ', ' ', ' ', ' ', '11',' ', ' ', ' ', ' ', ' ', ' ', '3', '2' ],
3643
+ [' ', ' ', ' ', ' ', '2', ' ', ' ', ' ', '11',' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '2', ' ' ],
3644
+ [' ', ' ', ' ', '2', ' ', ' ', ' ', ' ', ' ', ' ', '6', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' ],
3645
+ [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '3', ' ', ' ', ' ', ' ', ' ', ' ', ' ' ],
3646
+ [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '2', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' ],
3647
+ [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '2', ' ', ' ', ' ', ' ', ' ', ' ', ' ' ],
3648
+ [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '28','4', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' ],
3649
+ [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '10',' ', '10',' ', ' ', ' ', ' ', '45',' ' ],
3650
+ [' ', ' ', '3', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' ],
3651
+ [' ', '22',' ', ' ', ' ', ' ', ' ', '28',' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '17'],
3652
+ [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' ],
3653
+ [' ', '8', '3', ' ', ' ', '2', '2', ' ', ' ', ' ', '5', ' ', ' ', '4', ' ', ' ', ' ', ' ', ' ' ],
3654
+ [' ', ' ', ' ', ' ', '4', ' ', ' ', '8', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '2', ' ', ' ', ' ' ],
3655
+ [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '3', ' ' ],
3656
+ [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' ],
3657
+ ['2', ' ', ' ', ' ', '12',' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' ],
3658
+ ['2', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' ],
3659
+ [' ', ' ', '3', '2', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '60',' ', ' ', ' ', ' ', ' ', '4', ' ' ],
3660
+ ])
3661
+ binst = solver.Board(board=board)
3662
+ solutions = binst.solve_and_print()
3663
+ ```
3664
+
3665
+ **Script Output**
3666
+
3667
+ ```python
3668
+ Solution found
3669
+ 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1
3670
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8
3671
+ ┌───────────┬───────────────────────────────────────────────────────────┬───┐
3672
+ 0│ 3 │ 15 │ │
3673
+ ├───────┬───┼───┬───────────────────────────────────────────┬───────────┤ │
3674
+ 1│ │ 2 │ 2 │ 11 │ 3 │ 2 │
3675
+ │ │ │ ├───┬───────────────────────────────────────┴───┬───────┼───┤
3676
+ 2│ │ │ │ 2 │ 11 │ 2 │ │
3677
+ │ ├───┴───┤ ├───────────────────────┬───┬───┬───────────┴───────┤ │
3678
+ 3│ │ 2 │ │ 6 │ │ │ │ │
3679
+ │ ├───────┴───┴───────────────┬───┬───┤ │ │ │ │
3680
+ 4│ │ │ │ │ 3 │ │ │ │
3681
+ │ │ │ │ │ │ │ │ │
3682
+ 5│ │ │ │ 2 │ │ │ │ │
3683
+ │ │ │ ├───┴───┤ │ │ │
3684
+ 6│ │ │ │ 2 │ │ │ │
3685
+ │ │ │ ├───────┤ │ │ │
3686
+ 7│ │ 28 │ 4 │ │ │ │ │
3687
+ │ ├───┬───────────────────────┴───┤ │ │ │ │
3688
+ 8│ │ │ │10 │10 │ 45 │ │
3689
+ │ │ │ │ │ │ │ │
3690
+ 9│ │ 3 │ │ │ │ │ │
3691
+ │ │ │ │ │ │ │ │
3692
+ 10│ 22 │ │ 28 │ │ │ │17 │
3693
+ │ ├───┤ │ │ │ │ │
3694
+ 11│ │ │ │ │ │ │ │
3695
+ ├───────┤ ├───────┬───┬───┬───────────┴───────┤ ├───────────────┬───┤ │
3696
+ 12│ 8 │ 3 │ │ 2 │ 2 │ 5 │ │ 4 │ │ │
3697
+ │ │ │ │ │ ├───────────────────┴───┴───────┬───────┤ │ │
3698
+ 13│ │ │ 4 │ │ │ 8 │ 2 │ │ │
3699
+ │ ├───┴───────┼───┴───┴───────────────────────────────┴───────┤ │ │
3700
+ 14│ │ │ │ 3 │ │
3701
+ │ │ │ ├───┤ │
3702
+ 15│ │ │ │ │ │
3703
+ ├───────┤ │ │ │ │
3704
+ 16│ 2 │ 12 │ │ │ │
3705
+ ├───────┤ │ │ │ │
3706
+ 17│ 2 │ │ │ │ │
3707
+ ├───────┴───┬───────┤ │ │ │
3708
+ 18│ 3 │ 2 │ 60 │ 4 │ │
3709
+ └───────────┴───────┴───────────────────────────────────────────────┴───┴───┘
3710
+ Solutions found: 1
3711
+ status: OPTIMAL
3712
+ Time taken: 0.01 seconds
3713
+ ```
3714
+
3715
+ **Solved puzzle**
3716
+
3717
+ Applying the solution to the puzzle visually:
3718
+
3719
+ <img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/rectangles_solved.png" alt="Rectangles solved" width="500">
3720
+
3721
+ ---
3722
+
3388
3723
  ---
3389
3724
 
3390
3725
  ## Why SAT / CP-SAT?
@@ -3475,3 +3810,6 @@ Issues and PRs welcome!
3475
3810
  [37]: https://github.com/Ar-Kareem/puzzle_solver/tree/master/src/puzzle_solver/puzzles/unequal "puzzle_solver/src/puzzle_solver/puzzles/unequal at master · Ar-Kareem/puzzle_solver · GitHub"
3476
3811
  [38]: https://github.com/Ar-Kareem/puzzle_solver/tree/master/src/puzzle_solver/puzzles/norinori "puzzle_solver/src/puzzle_solver/puzzles/norinori at master · Ar-Kareem/puzzle_solver · GitHub"
3477
3812
  [39]: https://github.com/Ar-Kareem/puzzle_solver/tree/master/src/puzzle_solver/puzzles/slitherlink "puzzle_solver/src/puzzle_solver/puzzles/slitherlink at master · Ar-Kareem/puzzle_solver · GitHub"
3813
+ [40]: https://github.com/Ar-Kareem/puzzle_solver/tree/master/src/puzzle_solver/puzzles/yin_yang "puzzle_solver/src/puzzle_solver/puzzles/yin_yang at master · Ar-Kareem/puzzle_solver · GitHub"
3814
+ [41]: https://github.com/Ar-Kareem/puzzle_solver/tree/master/src/puzzle_solver/puzzles/binairo "puzzle_solver/src/puzzle_solver/puzzles/binairo at master · Ar-Kareem/puzzle_solver · GitHub"
3815
+ [42]: https://github.com/Ar-Kareem/puzzle_solver/tree/master/src/puzzle_solver/puzzles/rectangles "puzzle_solver/src/puzzle_solver/puzzles/rectangles at master · Ar-Kareem/puzzle_solver · GitHub"