multi-puzzle-solver 0.9.27__tar.gz → 0.9.30__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 (122) hide show
  1. {multi_puzzle_solver-0.9.27/src/multi_puzzle_solver.egg-info → multi_puzzle_solver-0.9.30}/PKG-INFO +861 -46
  2. multi_puzzle_solver-0.9.27/PKG-INFO → multi_puzzle_solver-0.9.30/README.md +4900 -4111
  3. multi_puzzle_solver-0.9.27/README.md → multi_puzzle_solver-0.9.30/src/multi_puzzle_solver.egg-info/PKG-INFO +4926 -4085
  4. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/multi_puzzle_solver.egg-info/SOURCES.txt +12 -0
  5. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/__init__.py +7 -1
  6. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/core/utils_visualizer.py +214 -1
  7. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/binairo/binairo.py +44 -16
  8. multi_puzzle_solver-0.9.30/src/puzzle_solver/puzzles/binairo/binairo_plus.py +7 -0
  9. multi_puzzle_solver-0.9.30/src/puzzle_solver/puzzles/heyawake/heyawake.py +94 -0
  10. multi_puzzle_solver-0.9.30/src/puzzle_solver/puzzles/kakuro/kakuro.py +77 -0
  11. multi_puzzle_solver-0.9.30/src/puzzle_solver/puzzles/shakashaka/shakashaka.py +201 -0
  12. multi_puzzle_solver-0.9.30/src/puzzle_solver/puzzles/shingoki/shingoki.py +158 -0
  13. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/singles/singles.py +14 -40
  14. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/stitches/parse_map/parse_map.py +3 -1
  15. multi_puzzle_solver-0.9.30/src/puzzle_solver/puzzles/tapa/tapa.py +98 -0
  16. multi_puzzle_solver-0.9.30/tests/test_binairo_plus.py +183 -0
  17. multi_puzzle_solver-0.9.30/tests/test_heyawake.py +149 -0
  18. multi_puzzle_solver-0.9.30/tests/test_kakuro.py +94 -0
  19. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/tests/test_range.py +31 -15
  20. multi_puzzle_solver-0.9.30/tests/test_shakashaka.py +175 -0
  21. multi_puzzle_solver-0.9.30/tests/test_shingoki.py +171 -0
  22. multi_puzzle_solver-0.9.30/tests/test_tapa.py +126 -0
  23. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/pyproject.toml +0 -0
  24. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/setup.cfg +0 -0
  25. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/multi_puzzle_solver.egg-info/dependency_links.txt +0 -0
  26. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/multi_puzzle_solver.egg-info/requires.txt +0 -0
  27. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/multi_puzzle_solver.egg-info/top_level.txt +0 -0
  28. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/core/utils.py +0 -0
  29. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/core/utils_ortools.py +0 -0
  30. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/aquarium/aquarium.py +0 -0
  31. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/battleships/battleships.py +0 -0
  32. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/black_box/black_box.py +0 -0
  33. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/bridges/bridges.py +0 -0
  34. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/chess_range/chess_melee.py +0 -0
  35. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/chess_range/chess_range.py +0 -0
  36. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/chess_range/chess_solo.py +0 -0
  37. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/dominosa/dominosa.py +0 -0
  38. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/filling/filling.py +0 -0
  39. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/flip/flip.py +0 -0
  40. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/galaxies/galaxies.py +0 -0
  41. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/galaxies/parse_map/parse_map.py +0 -0
  42. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/guess/guess.py +0 -0
  43. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/inertia/inertia.py +0 -0
  44. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/inertia/parse_map/parse_map.py +0 -0
  45. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/inertia/tsp.py +0 -0
  46. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/kakurasu/kakurasu.py +0 -0
  47. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/keen/keen.py +0 -0
  48. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/light_up/light_up.py +0 -0
  49. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/lits/lits.py +0 -0
  50. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/magnets/magnets.py +0 -0
  51. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/map/map.py +0 -0
  52. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/minesweeper/minesweeper.py +0 -0
  53. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/mosaic/mosaic.py +0 -0
  54. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/nonograms/nonograms.py +0 -0
  55. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/norinori/norinori.py +0 -0
  56. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/nurikabe/nurikabe.py +0 -0
  57. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/palisade/palisade.py +0 -0
  58. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/pearl/pearl.py +0 -0
  59. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/range/range.py +0 -0
  60. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/rectangles/rectangles.py +0 -0
  61. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/signpost/signpost.py +0 -0
  62. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/slant/parse_map/parse_map.py +0 -0
  63. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/slant/slant.py +0 -0
  64. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/slitherlink/slitherlink.py +0 -0
  65. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/star_battle/star_battle.py +0 -0
  66. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/star_battle/star_battle_shapeless.py +0 -0
  67. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/stitches/stitches.py +0 -0
  68. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/sudoku/sudoku.py +0 -0
  69. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/tents/tents.py +0 -0
  70. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/thermometers/thermometers.py +0 -0
  71. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/towers/towers.py +0 -0
  72. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/tracks/tracks.py +0 -0
  73. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/undead/undead.py +0 -0
  74. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/unequal/unequal.py +0 -0
  75. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/unruly/unruly.py +0 -0
  76. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/yin_yang/parse_map/parse_map.py +0 -0
  77. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/puzzles/yin_yang/yin_yang.py +0 -0
  78. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/src/puzzle_solver/utils/visualizer.py +0 -0
  79. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/tests/test_aquarium.py +0 -0
  80. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/tests/test_battleships.py +0 -0
  81. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/tests/test_binairo.py +0 -0
  82. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/tests/test_black_box.py +0 -0
  83. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/tests/test_bridges.py +0 -0
  84. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/tests/test_chess_melee.py +0 -0
  85. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/tests/test_chess_range.py +0 -0
  86. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/tests/test_chess_solo.py +0 -0
  87. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/tests/test_dominosa.py +0 -0
  88. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/tests/test_filling.py +0 -0
  89. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/tests/test_flip.py +0 -0
  90. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/tests/test_galaxies.py +0 -0
  91. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/tests/test_guess.py +0 -0
  92. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/tests/test_inertia.py +0 -0
  93. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/tests/test_kakurasu.py +0 -0
  94. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/tests/test_keen.py +0 -0
  95. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/tests/test_light_up.py +0 -0
  96. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/tests/test_lits.py +0 -0
  97. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/tests/test_magnets.py +0 -0
  98. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/tests/test_map.py +0 -0
  99. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/tests/test_minesweeper.py +0 -0
  100. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/tests/test_mosaic.py +0 -0
  101. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/tests/test_nonograms.py +0 -0
  102. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/tests/test_norinori.py +0 -0
  103. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/tests/test_nurikabe.py +0 -0
  104. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/tests/test_palisade.py +0 -0
  105. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/tests/test_pearl.py +0 -0
  106. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/tests/test_rectangles.py +0 -0
  107. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/tests/test_signpost.py +0 -0
  108. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/tests/test_singles.py +0 -0
  109. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/tests/test_slant.py +0 -0
  110. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/tests/test_slitherlink.py +0 -0
  111. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/tests/test_star_battle.py +0 -0
  112. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/tests/test_stitches.py +0 -0
  113. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/tests/test_sudoku.py +0 -0
  114. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/tests/test_tents.py +0 -0
  115. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/tests/test_thermometers.py +0 -0
  116. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/tests/test_towers.py +0 -0
  117. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/tests/test_tracks.py +0 -0
  118. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/tests/test_undead.py +0 -0
  119. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/tests/test_unequal.py +0 -0
  120. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/tests/test_unruly.py +0 -0
  121. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/tests/test_utils.py +0 -0
  122. {multi_puzzle_solver-0.9.27 → multi_puzzle_solver-0.9.30}/tests/test_yin_yang.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: multi-puzzle-solver
3
- Version: 0.9.27
3
+ Version: 0.9.30
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
@@ -26,7 +26,7 @@ Requires-Dist: pytest-xdist; extra == "dev"
26
26
 
27
27
  # Python Puzzle Solver
28
28
 
29
- Solve numerous classical logic puzzles automatically in Python.
29
+ Solve countless (50+) 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 many popular pencil logic puzzles like Nonograms, Sudoku, Minesweeper, and many more lesser known ones.
76
+ The aim of this repo is to provide very efficient solvers (i.e. not brute force solvers) for countless (50+) 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
 
@@ -338,7 +338,34 @@ These are all the puzzles that are implemented in this repo. <br> Click on any o
338
338
  </td>
339
339
  <td align="center">
340
340
  <a href="#nurikabe-puzzle-type-45"><b>Nurikabe</b><br><br>
341
- <img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/nurikabe_unsolved.png" alt="Nurikabe" width="140">
341
+ <img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/nurikabe_solved.png" alt="Nurikabe" width="140">
342
+ </a>
343
+ </td>
344
+ </tr>
345
+ <tr>
346
+ <td align="center">
347
+ <a href="#heyawake-puzzle-type-46"><b>Heyawake</b><br><br>
348
+ <img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/heyawake_solved.png" alt="Heyawake" width="140">
349
+ </a>
350
+ </td>
351
+ <td align="center">
352
+ <a href="#shingoki-puzzle-type-47"><b>Shingoki</b><br><br>
353
+ <img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/shingoki_solved.png" alt="Shingoki" width="140">
354
+ </a>
355
+ </td>
356
+ <td align="center">
357
+ <a href="#tapa-puzzle-type-48"><b>Tapa</b><br><br>
358
+ <img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/tapa_solved.png" alt="Tapa" width="140">
359
+ </a>
360
+ </td>
361
+ <td align="center">
362
+ <a href="#binairo-plus-puzzle-type-49"><b>Binairo Plus</b><br><br>
363
+ <img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/binairo_plus_solved.png" alt="Binairo Plus" width="140">
364
+ </a>
365
+ </td>
366
+ <td align="center">
367
+ <a href="#shakashaka-puzzle-type-50"><b>Shakashaka</b><br><br>
368
+ <img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/shakashaka_solved.png" alt="Shakashaka" width="140">
342
369
  </a>
343
370
  </td>
344
371
  </tr>
@@ -401,6 +428,12 @@ These are all the puzzles that are implemented in this repo. <br> Click on any o
401
428
  - [Palisade (Puzzle Type #43)](#palisade-puzzle-type-43)
402
429
  - [Flip (Puzzle Type #44)](#flip-puzzle-type-44)
403
430
  - [Nurikabe (Puzzle Type #45)](#nurikabe-puzzle-type-45)
431
+ - [Heyawake (Puzzle Type #46)](#heyawake-puzzle-type-46)
432
+ - [Shingoki (Puzzle Type #47)](#shingoki-puzzle-type-47)
433
+ - [Tapa (Puzzle Type #48)](#tapa-puzzle-type-48)
434
+ - [Binairo Plus (Puzzle Type #49)](#binairo-plus-puzzle-type-49)
435
+ - [Shakashaka (Puzzle Type #50)](#shakashaka-puzzle-type-50)
436
+ - [Kakuro (Puzzle Type #51)](#kakuro-puzzle-type-51)
404
437
  - [Why SAT / CP-SAT?](#why-sat--cp-sat)
405
438
  - [Testing](#testing)
406
439
  - [Contributing](#contributing)
@@ -1088,7 +1121,11 @@ Time taken: 0.03 seconds
1088
1121
 
1089
1122
  ## Singles (Puzzle Type #10)
1090
1123
 
1091
- * [**Play online**](https://www.chiark.greenend.org.uk/~sgtatham/puzzles/js/singles.html)
1124
+ Also known as "Hitori",
1125
+
1126
+ * [**Play online 1**](https://www.chiark.greenend.org.uk/~sgtatham/puzzles/js/singles.html)
1127
+
1128
+ * [**Play online 2**](https://www.puzzle-hitori.com/)
1092
1129
 
1093
1130
  * [**Instructions**](https://www.chiark.greenend.org.uk/~sgtatham/puzzles/doc/singles.html#singles)
1094
1131
 
@@ -1128,24 +1165,41 @@ board = np.array([
1128
1165
  binst = solver.Board(board=board)
1129
1166
  solutions = binst.solve_and_print()
1130
1167
  ```
1168
+
1131
1169
  **Script Output**
1170
+
1132
1171
  ```python
1133
1172
  Solution found
1134
- [['B' ' ' 'B' ' ' 'B' ' ' ' ' 'B' ' ' ' ' ' ' ' ']
1135
- [' ' ' ' ' ' ' ' ' ' 'B' ' ' ' ' ' ' 'B' ' ' 'B']
1136
- ['B' ' ' 'B' ' ' 'B' ' ' 'B' ' ' 'B' ' ' 'B' ' ']
1137
- [' ' ' ' ' ' 'B' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ']
1138
- ['B' ' ' 'B' ' ' ' ' 'B' ' ' 'B' ' ' 'B' ' ' 'B']
1139
- [' ' ' ' ' ' 'B' ' ' ' ' 'B' ' ' ' ' ' ' 'B' ' ']
1140
- [' ' 'B' ' ' ' ' 'B' ' ' ' ' 'B' ' ' 'B' ' ' ' ']
1141
- [' ' ' ' 'B' ' ' ' ' ' ' 'B' ' ' ' ' ' ' ' ' ' ']
1142
- [' ' 'B' ' ' ' ' ' ' 'B' ' ' ' ' 'B' ' ' ' ' 'B']
1143
- ['B' ' ' 'B' ' ' 'B' ' ' ' ' 'B' ' ' ' ' 'B' ' ']
1144
- [' ' ' ' ' ' ' ' ' ' 'B' ' ' ' ' 'B' ' ' ' ' ' ']
1145
- ['B' ' ' ' ' 'B' ' ' ' ' ' ' 'B' ' ' ' ' 'B' ' ']]
1173
+ 0 0 0 0 0 0 0 0 0 0 1 1
1174
+ 0 1 2 3 4 5 6 7 8 9 0 1
1175
+ ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐
1176
+ 0│▒▒▒│ 6 │▒▒▒│ 4 │▒▒▒│ 8 9 │▒▒▒│ 5 1 3 7
1177
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
1178
+ 1│ 2 8 5 7 1 │▒▒▒│ 4 3 6 │▒▒▒│10 │▒▒▒│
1179
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
1180
+ 2│▒▒▒│ 7 │▒▒▒│11 │▒▒▒│ 6 │▒▒▒│10 │▒▒▒│ 2 │▒▒▒│ 3
1181
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
1182
+ 3│11 9 4 │▒▒▒│ 6 1 2 5 3 │10 7 │ 8 │
1183
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
1184
+ 4│▒▒▒│ 5 │▒▒▒│ 9 7 │▒▒▒│ 6 │▒▒▒│11 │▒▒▒│ 4 │▒▒▒│
1185
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
1186
+ 5│ 1 │ 3 │ 7 │▒▒▒│12 │ 5 │▒▒▒│ 2 │ 9 │ 6 │▒▒▒│ 4 │
1187
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
1188
+ 6│ 6 │▒▒▒│ 1 │ 3 │▒▒▒│ 4 │11 │▒▒▒│ 2 │▒▒▒│ 8 │10 │
1189
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
1190
+ 7│ 3 │11 │▒▒▒│ 6 │ 2 │ 9 │▒▒▒│ 1 │ 4 │ 8 │12 │ 5 │
1191
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
1192
+ 8│ 4 │▒▒▒│ 8 │ 5 │11 │▒▒▒│ 3 │ 6 │▒▒▒│ 9 │ 1 │▒▒▒│
1193
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
1194
+ 9│▒▒▒│ 4 │▒▒▒│ 2 │▒▒▒│10 │ 1 │▒▒▒│ 8 │ 5 │▒▒▒│ 6 │
1195
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
1196
+ 10│ 5 │ 1 │ 6 │10 │ 9 │▒▒▒│ 8 │ 4 │▒▒▒│ 3 │ 2 │12 │
1197
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
1198
+ 11│▒▒▒│ 2 │12 │▒▒▒│ 8 │ 3 │ 5 │▒▒▒│10 │ 4 │▒▒▒│11 │
1199
+ └───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┘
1146
1200
  Solutions found: 1
1147
1201
  status: OPTIMAL
1148
- Time taken: 2.14 seconds
1202
+ Time taken: 0.04 seconds
1149
1203
  ```
1150
1204
 
1151
1205
  **Solved puzzle**
@@ -1290,7 +1344,11 @@ Time taken: 0.03 seconds
1290
1344
 
1291
1345
  ## Range (Puzzle Type #13)
1292
1346
 
1293
- * [**Play online**](https://www.chiark.greenend.org.uk/~sgtatham/puzzles/js/range.html)
1347
+ Also known as "Kurodoko"
1348
+
1349
+ * [**Play online 1**](https://www.chiark.greenend.org.uk/~sgtatham/puzzles/js/range.html)
1350
+
1351
+ * [**Play online 2**](https://www.puzzle-kurodoko.com/)
1294
1352
 
1295
1353
  * [**Instructions**](https://www.chiark.greenend.org.uk/~sgtatham/puzzles/doc/range.html#range)
1296
1354
 
@@ -3594,31 +3652,52 @@ solutions = binst.solve_and_print()
3594
3652
 
3595
3653
  ```python
3596
3654
  Solution found
3597
- [
3598
- [ 'B', 'B', 'W', 'B', 'W', 'B', 'W', 'B', 'W', 'W', 'B', 'W', 'W', 'B', 'W', 'B', 'B', 'W', 'B', 'W' ],
3599
- [ 'W', 'W', 'B', 'W', 'B', 'B', 'W', 'B', 'B', 'W', 'B', 'W', 'W', 'B', 'B', 'W', 'W', 'B', 'B', 'W' ],
3600
- [ 'W', 'W', 'B', 'B', 'W', 'W', 'B', 'W', 'W', 'B', 'W', 'B', 'B', 'W', 'B', 'W', 'B', 'B', 'W', 'B' ],
3601
- [ 'B', 'B', 'W', 'W', 'B', 'W', 'B', 'W', 'B', 'W', 'W', 'B', 'B', 'W', 'W', 'B', 'W', 'W', 'B', 'B' ],
3602
- [ 'B', 'W', 'B', 'W', 'W', 'B', 'W', 'B', 'W', 'B', 'B', 'W', 'W', 'B', 'W', 'B', 'W', 'B', 'B', 'W' ],
3603
- [ 'W', 'B', 'W', 'B', 'B', 'W', 'W', 'B', 'B', 'W', 'W', 'B', 'B', 'W', 'B', 'W', 'B', 'W', 'W', 'B' ],
3604
- [ 'W', 'B', 'W', 'W', 'B', 'W', 'B', 'W', 'W', 'B', 'B', 'W', 'B', 'B', 'W', 'B', 'W', 'B', 'B', 'W' ],
3605
- [ 'B', 'W', 'B', 'W', 'W', 'B', 'W', 'B', 'B', 'W', 'B', 'B', 'W', 'W', 'B', 'W', 'W', 'B', 'W', 'B' ],
3606
- [ 'W', 'B', 'W', 'B', 'W', 'B', 'B', 'W', 'W', 'B', 'W', 'B', 'B', 'W', 'W', 'B', 'B', 'W', 'B', 'W' ],
3607
- [ 'B', 'W', 'W', 'B', 'B', 'W', 'W', 'B', 'W', 'B', 'B', 'W', 'W', 'B', 'B', 'W', 'W', 'B', 'W', 'B' ],
3608
- [ 'W', 'B', 'B', 'W', 'B', 'W', 'B', 'W', 'B', 'W', 'B', 'W', 'B', 'B', 'W', 'W', 'B', 'B', 'W', 'W' ],
3609
- [ 'B', 'W', 'B', 'W', 'W', 'B', 'B', 'W', 'B', 'B', 'W', 'B', 'W', 'W', 'B', 'B', 'W', 'W', 'B', 'W' ],
3610
- [ 'B', 'W', 'W', 'B', 'B', 'W', 'W', 'B', 'W', 'B', 'W', 'W', 'B', 'W', 'B', 'W', 'B', 'W', 'B', 'B' ],
3611
- [ 'W', 'B', 'B', 'W', 'B', 'B', 'W', 'B', 'W', 'W', 'B', 'B', 'W', 'B', 'W', 'B', 'W', 'B', 'W', 'W' ],
3612
- [ 'B', 'W', 'W', 'B', 'W', 'B', 'B', 'W', 'B', 'B', 'W', 'W', 'B', 'W', 'W', 'B', 'B', 'W', 'W', 'B' ],
3613
- [ 'W', 'B', 'W', 'B', 'W', 'W', 'B', 'W', 'B', 'B', 'W', 'B', 'W', 'B', 'B', 'W', 'B', 'W', 'B', 'W' ],
3614
- [ 'W', 'B', 'B', 'W', 'B', 'W', 'W', 'B', 'W', 'W', 'B', 'W', 'B', 'W', 'B', 'B', 'W', 'B', 'W', 'B' ],
3615
- [ 'B', 'W', 'B', 'W', 'W', 'B', 'B', 'W', 'B', 'B', 'W', 'W', 'B', 'B', 'W', 'W', 'B', 'W', 'B', 'W' ],
3616
- [ 'W', 'B', 'W', 'B', 'B', 'W', 'B', 'W', 'B', 'W', 'W', 'B', 'W', 'B', 'W', 'B', 'W', 'B', 'W', 'B' ],
3617
- [ 'B', 'W', 'B', 'B', 'W', 'B', 'W', 'B', 'W', 'W', 'B', 'B', 'W', 'W', 'B', 'W', 'B', 'W', 'W', 'B' ],
3618
- ]
3655
+ 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1
3656
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
3657
+ ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐
3658
+ 0│▒▒▒│▒▒▒│ │▒▒▒│ │▒▒▒│ │▒▒▒│ │ │▒▒▒│ │ │▒▒▒│ │▒▒▒│▒▒▒│ │▒▒▒│ │
3659
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
3660
+ 1│ │ │▒▒▒│ │▒▒▒│▒▒▒│ │▒▒▒│▒▒▒│ │▒▒▒│ │ │▒▒▒│▒▒▒│ │ │▒▒▒│▒▒▒│ │
3661
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
3662
+ 2│ │ │▒▒▒│▒▒▒│ │ │▒▒▒│ │ │▒▒▒│ │▒▒▒│▒▒▒│ │▒▒▒│ │▒▒▒│▒▒▒│ │▒▒▒│
3663
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
3664
+ 3│▒▒▒│▒▒▒│ │ │▒▒▒│ │▒▒▒│ │▒▒▒│ │ │▒▒▒│▒▒▒│ │ │▒▒▒│ │ │▒▒▒│▒▒▒│
3665
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
3666
+ 4│▒▒▒│ │▒▒▒│ │ │▒▒▒│ │▒▒▒│ │▒▒▒│▒▒▒│ │ │▒▒▒│ │▒▒▒│ │▒▒▒│▒▒▒│ │
3667
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
3668
+ 5│ │▒▒▒│ │▒▒▒│▒▒▒│ │ │▒▒▒│▒▒▒│ │ │▒▒▒│▒▒▒│ │▒▒▒│ │▒▒▒│ │ │▒▒▒│
3669
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
3670
+ 6│ │▒▒▒│ │ │▒▒▒│ │▒▒▒│ │ │▒▒▒│▒▒▒│ │▒▒▒│▒▒▒│ │▒▒▒│ │▒▒▒│▒▒▒│ │
3671
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
3672
+ 7│▒▒▒│ │▒▒▒│ │ │▒▒▒│ │▒▒▒│▒▒▒│ │▒▒▒│▒▒▒│ │ │▒▒▒│ │ │▒▒▒│ │▒▒▒│
3673
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
3674
+ 8│ │▒▒▒│ │▒▒▒│ │▒▒▒│▒▒▒│ │ │▒▒▒│ │▒▒▒│▒▒▒│ │ │▒▒▒│▒▒▒│ │▒▒▒│ │
3675
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
3676
+ 9│▒▒▒│ │ │▒▒▒│▒▒▒│ │ │▒▒▒│ │▒▒▒│▒▒▒│ │ │▒▒▒│▒▒▒│ │ │▒▒▒│ │▒▒▒│
3677
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
3678
+ 10│ │▒▒▒│▒▒▒│ │▒▒▒│ │▒▒▒│ │▒▒▒│ │▒▒▒│ │▒▒▒│▒▒▒│ │ │▒▒▒│▒▒▒│ │ │
3679
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
3680
+ 11│▒▒▒│ │▒▒▒│ │ │▒▒▒│▒▒▒│ │▒▒▒│▒▒▒│ │▒▒▒│ │ │▒▒▒│▒▒▒│ │ │▒▒▒│ │
3681
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
3682
+ 12│▒▒▒│ │ │▒▒▒│▒▒▒│ │ │▒▒▒│ │▒▒▒│ │ │▒▒▒│ │▒▒▒│ │▒▒▒│ │▒▒▒│▒▒▒│
3683
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
3684
+ 13│ │▒▒▒│▒▒▒│ │▒▒▒│▒▒▒│ │▒▒▒│ │ │▒▒▒│▒▒▒│ │▒▒▒│ │▒▒▒│ │▒▒▒│ │ │
3685
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
3686
+ 14│▒▒▒│ │ │▒▒▒│ │▒▒▒│▒▒▒│ │▒▒▒│▒▒▒│ │ │▒▒▒│ │ │▒▒▒│▒▒▒│ │ │▒▒▒│
3687
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
3688
+ 15│ │▒▒▒│ │▒▒▒│ │ │▒▒▒│ │▒▒▒│▒▒▒│ │▒▒▒│ │▒▒▒│▒▒▒│ │▒▒▒│ │▒▒▒│ │
3689
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
3690
+ 16│ │▒▒▒│▒▒▒│ │▒▒▒│ │ │▒▒▒│ │ │▒▒▒│ │▒▒▒│ │▒▒▒│▒▒▒│ │▒▒▒│ │▒▒▒│
3691
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
3692
+ 17│▒▒▒│ │▒▒▒│ │ │▒▒▒│▒▒▒│ │▒▒▒│▒▒▒│ │ │▒▒▒│▒▒▒│ │ │▒▒▒│ │▒▒▒│ │
3693
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
3694
+ 18│ │▒▒▒│ │▒▒▒│▒▒▒│ │▒▒▒│ │▒▒▒│ │ │▒▒▒│ │▒▒▒│ │▒▒▒│ │▒▒▒│ │▒▒▒│
3695
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
3696
+ 19│▒▒▒│ │▒▒▒│▒▒▒│ │▒▒▒│ │▒▒▒│ │ │▒▒▒│▒▒▒│ │ │▒▒▒│ │▒▒▒│ │ │▒▒▒│
3697
+ └───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┘
3619
3698
  Solutions found: 1
3620
3699
  status: OPTIMAL
3621
- Time taken: 0.03 seconds
3700
+ Time taken: 0.02 seconds
3622
3701
  ```
3623
3702
 
3624
3703
  **Solved puzzle**
@@ -3893,6 +3972,7 @@ This picture won't mean much as the game is about the sequence of moves not the
3893
3972
  <img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/flip_solved.png" alt="Flip solved" width="500">
3894
3973
 
3895
3974
  ---
3975
+
3896
3976
  ## Nurikabe (Puzzle Type #45)
3897
3977
 
3898
3978
  * [**Play online**](https://www.puzzle-nurikabe.com/)
@@ -3922,8 +4002,6 @@ Read more about the history and methods behind nurikabe in the [Wikipedia nurika
3922
4002
 
3923
4003
  Code to utilize this package and solve the puzzle:
3924
4004
 
3925
- (Note: the solver also supports random mapping of squares to the neighbors they flip, see the test cases in `tests/test_flip.py` for usage examples)
3926
-
3927
4005
  ```python
3928
4006
  import numpy as np
3929
4007
  from puzzle_solver import nurikabe_solver as solver
@@ -3955,8 +4033,6 @@ solutions = binst.solve_and_print()
3955
4033
 
3956
4034
  **Script Output**
3957
4035
 
3958
- The output tells you which squares to tap to solve the puzzle.
3959
-
3960
4036
  ```python
3961
4037
  Solution found
3962
4038
  0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1
@@ -4013,6 +4089,739 @@ Time taken: 1.62 seconds
4013
4089
 
4014
4090
  ---
4015
4091
 
4092
+ ## Heyawake (Puzzle Type #46)
4093
+
4094
+ * [**Play online**](https://www.puzzle-heyawake.com/)
4095
+
4096
+ * [**Solver Code**][46]
4097
+
4098
+ <details>
4099
+ <summary><strong>Rules</strong></summary>
4100
+
4101
+ You have to color the cells of the grid in black and white according to the rules:
4102
+ - Regions with a number should contain black cells matching the number.
4103
+ - 2 black cells cannot be adjacent horizontally or vertically.
4104
+ - A straight (orthogonal) line of connected white cells cannot span across more than 2 regions.
4105
+ - All white cells should be connected in a single group.
4106
+
4107
+ </details>
4108
+
4109
+ **Unsolved puzzle**
4110
+
4111
+ <img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/heyawake_unsolved.png" alt="Heyawake unsolved" width="500">
4112
+
4113
+ Code to utilize this package and solve the puzzle:
4114
+
4115
+ ```python
4116
+ import numpy as np
4117
+ from puzzle_solver import heyawake_solver as solver
4118
+ board = np.array([
4119
+ ['00', '01', '02', '03', '04', '04', '04', '04', '04', '04', '04', '04', '04', '04', '05', '05', '06', '06', '07', '07'],
4120
+ ['00', '08', '02', '03', '09', '09', '10', '10', '10', '11', '11', '12', '12', '12', '05', '05', '06', '06', '07', '07'],
4121
+ ['00', '08', '02', '03', '09', '09', '13', '13', '13', '11', '11', '12', '12', '12', '14', '14', '14', '15', '15', '16'],
4122
+ ['17', '17', '17', '03', '09', '09', '18', '18', '19', '11', '11', '20', '20', '21', '21', '22', '22', '15', '15', '16'],
4123
+ ['17', '17', '17', '23', '23', '23', '23', '23', '19', '11', '11', '24', '24', '21', '21', '25', '25', '25', '25', '26'],
4124
+ ['27', '28', '28', '23', '23', '23', '23', '23', '29', '29', '30', '31', '32', '32', '32', '25', '25', '25', '25', '26'],
4125
+ ['27', '28', '28', '33', '34', '34', '35', '35', '35', '36', '30', '31', '32', '32', '32', '25', '25', '25', '25', '26'],
4126
+ ['27', '28', '28', '33', '34', '34', '35', '35', '35', '37', '37', '31', '32', '32', '32', '25', '25', '25', '25', '38'],
4127
+ ['27', '28', '28', '39', '39', '39', '40', '40', '40', '41', '41', '31', '42', '42', '42', '42', '42', '43', '43', '38'],
4128
+ ['27', '28', '28', '39', '39', '39', '40', '40', '40', '41', '41', '44', '44', '44', '44', '44', '44', '43', '43', '38'],
4129
+ ['27', '45', '45', '39', '39', '39', '46', '46', '47', '41', '41', '44', '44', '44', '44', '44', '44', '48', '48', '48'],
4130
+ ['49', '45', '45', '50', '50', '50', '46', '46', '47', '41', '41', '51', '52', '52', '52', '52', '53', '53', '53', '54'],
4131
+ ['49', '55', '56', '57', '57', '57', '58', '58', '58', '41', '41', '51', '52', '52', '52', '52', '53', '53', '53', '54'],
4132
+ ['49', '55', '59', '57', '57', '57', '58', '58', '58', '60', '60', '61', '61', '62', '62', '63', '63', '63', '63', '54'],
4133
+ ['49', '64', '64', '57', '57', '57', '58', '58', '58', '60', '60', '61', '61', '62', '62', '63', '63', '63', '63', '54'],
4134
+ ['49', '64', '64', '65', '65', '66', '58', '58', '58', '60', '60', '61', '61', '67', '67', '63', '63', '63', '63', '54'],
4135
+ ['49', '64', '64', '65', '65', '66', '58', '58', '58', '60', '60', '61', '61', '67', '67', '68', '68', '69', '70', '54'],
4136
+ ['49', '71', '71', '72', '72', '72', '73', '74', '74', '74', '75', '76', '76', '67', '67', '68', '68', '69', '77', '54'],
4137
+ ['49', '71', '71', '72', '72', '72', '73', '74', '74', '74', '75', '78', '78', '78', '78', '79', '80', '80', '77', '54'],
4138
+ ['81', '81', '81', '81', '81', '81', '81', '82', '82', '82', '75', '83', '83', '83', '83', '79', '80', '80', '77', '54']
4139
+ ])
4140
+ region_to_clue = {
4141
+ '04': 4, '09': 0, '06': 0, '16': 0, '13': 2, '24': 0, '32': 5, '27': 3, '34': 0,
4142
+ '39': 3, '37': 0, '41': 3, '38': 2, '43': 0, '44': 4, '54': 3, '53': 2, '70': 1,
4143
+ '80': 2, '67': 1, '83': 2, '82': 2, '73': 0, '72': 1, '71': 2, '64': 1, '56': 1,
4144
+ '45': 0, '57': 2, '58': 5, '66': 0, '60': 3, '61': 2
4145
+ }
4146
+ binst = solver.Board(board=board, region_to_clue=region_to_clue)
4147
+ solutions = binst.solve_and_print()
4148
+ ```
4149
+
4150
+ **Script Output**
4151
+
4152
+ ```python
4153
+ Solution found
4154
+ 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1
4155
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
4156
+ ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐
4157
+ 0│ │ │▒▒▒│ │ 4 │▒▒▒│ 4 │▒▒▒│ 4 │ 4 │▒▒▒│ 4 │▒▒▒│ 4 │ │▒▒▒│ │ │ │ │
4158
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4159
+ 1│▒▒▒│ │ │▒▒▒│ │ │ │ │ │▒▒▒│ │ │ │ │▒▒▒│ │ │ │▒▒▒│ │
4160
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4161
+ 2│ │ │▒▒▒│ │ │ │▒▒▒│ 2 │▒▒▒│ │ │ │▒▒▒│ │ │▒▒▒│ │▒▒▒│ │ │
4162
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4163
+ 3│ │▒▒▒│ │▒▒▒│ │ │ │▒▒▒│ │ │ │▒▒▒│ │▒▒▒│ │ │▒▒▒│ │ │ │
4164
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4165
+ 4│ │ │ │ │▒▒▒│ │ │ │▒▒▒│ │▒▒▒│ │ │ │ │▒▒▒│ │ │ │▒▒▒│
4166
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4167
+ 5│▒▒▒│ │ │ │ │▒▒▒│ │ │ │▒▒▒│ │ │▒▒▒│ 5 │▒▒▒│ │ │ │▒▒▒│ │
4168
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4169
+ 6│ 3 │ │▒▒▒│ │ │ │▒▒▒│ │ │ │▒▒▒│ │ 5 │▒▒▒│ 5 │ │▒▒▒│ │ │ │
4170
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4171
+ 7│▒▒▒│ │ │▒▒▒│ │ │ │ │▒▒▒│ │ │ │▒▒▒│ 5 │▒▒▒│ │ │▒▒▒│ │▒▒▒│
4172
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4173
+ 8│ 3 │ │▒▒▒│ 3 │▒▒▒│ 3 │ │▒▒▒│ │▒▒▒│ 3 │▒▒▒│ │ │ │ │▒▒▒│ │ │ 2 │
4174
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4175
+ 9│ 3 │▒▒▒│ │ 3 │ 3 │▒▒▒│ │ │ │ 3 │▒▒▒│ 4 │ 4 │▒▒▒│ 4 │▒▒▒│ 4 │ │ │▒▒▒│
4176
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4177
+ 10│▒▒▒│ │ │ 3 │▒▒▒│ 3 │▒▒▒│ │ │▒▒▒│ 3 │▒▒▒│ 4 │ 4 │▒▒▒│ 4 │ 4 │ │▒▒▒│ │
4178
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4179
+ 11│ │ │ │▒▒▒│ │ │ │ │▒▒▒│ 3 │ 3 │ │▒▒▒│ │ │▒▒▒│ 2 │▒▒▒│ 2 │ 3 │
4180
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4181
+ 12│ │ │▒▒▒│ 2 │ 2 │▒▒▒│ 5 │▒▒▒│ 5 │ 3 │ 3 │▒▒▒│ │ │ │ │▒▒▒│ 2 │ 2 │▒▒▒│
4182
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4183
+ 13│ │▒▒▒│ │ 2 │ 2 │ 2 │▒▒▒│ 5 │ 5 │▒▒▒│ 3 │ 2 │ 2 │▒▒▒│ │ │ │▒▒▒│ │ 3 │
4184
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4185
+ 14│ │ 1 │▒▒▒│ 2 │ 2 │▒▒▒│ 5 │▒▒▒│ 5 │ 3 │▒▒▒│ 2 │ 2 │ │▒▒▒│ │ │ │ │▒▒▒│
4186
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4187
+ 15│▒▒▒│ 1 │ 1 │ │▒▒▒│ │ 5 │ 5 │ 5 │▒▒▒│ 3 │▒▒▒│ 2 │ 1 │ 1 │▒▒▒│ │ │ │ 3 │
4188
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4189
+ 16│ │ 1 │ 1 │▒▒▒│ │ │▒▒▒│ 5 │▒▒▒│ 3 │ 3 │ 2 │▒▒▒│ 1 │ 1 │ │▒▒▒│ │▒▒▒│ 3 │
4190
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4191
+ 17│ │ 2 │▒▒▒│ 1 │ 1 │ 1 │ │▒▒▒│ │ │ │▒▒▒│ │▒▒▒│ 1 │ │ │▒▒▒│ │ 3 │
4192
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4193
+ 18│ │▒▒▒│ 2 │ 1 │ 1 │▒▒▒│ │ │ │ │▒▒▒│ │ │ │ │ │▒▒▒│ 2 │ │▒▒▒│
4194
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4195
+ 19│ │ │ │ │▒▒▒│ │ │▒▒▒│ 2 │▒▒▒│ │ 2 │▒▒▒│ 2 │▒▒▒│ │ 2 │▒▒▒│ │ 3 │
4196
+ └───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┘
4197
+ Solutions found: 1
4198
+ status: OPTIMAL
4199
+ Time taken: 38.04 seconds
4200
+ ```
4201
+
4202
+ **Solved puzzle**
4203
+
4204
+ <img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/heyawake_solved.png" alt="Heyawake solved" width="500">
4205
+
4206
+ ---
4207
+
4208
+ ## Shingoki (Puzzle Type #47)
4209
+
4210
+ Also called "Semaphores".
4211
+
4212
+ * [**Play online**](https://www.puzzle-shingoki.com/)
4213
+
4214
+ * [**Solver Code**][47]
4215
+
4216
+ <details>
4217
+ <summary><strong>Rules</strong></summary>
4218
+
4219
+ You have to draw lines between the dots to form a single loop without crossings or branches. The loop should pass through all black and white circles in such a way that:
4220
+ - White circles must be passed through in a straight line
4221
+ - Black circles must be turned upon
4222
+ - The numbers in the circles show the sum of the lengths of the 2 straight lines going out of that circle.
4223
+
4224
+ </details>
4225
+
4226
+ **Unsolved puzzle**
4227
+
4228
+ <img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/shingoki_unsolved.png" alt="Shingoki unsolved" width="500">
4229
+
4230
+ Code to utilize this package and solve the puzzle:
4231
+
4232
+ ```python
4233
+ import numpy as np
4234
+ from puzzle_solver import shingoki_solver as solver
4235
+ board = np.array([
4236
+ [' ', ' ', ' ', ' ', ' ', '4B', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
4237
+ [' ', ' ', ' ', ' ', '5B', ' ', ' ', '2B', ' ', ' ', '3B', ' ', ' ', ' ', '3W', ' ', ' ', ' ', ' ', '2B', ' '],
4238
+ ['2B', '2B', ' ', '2W', ' ', ' ', ' ', ' ', ' ', ' ', '2B', ' ', '2B', ' ', ' ', ' ', '3B', '5W', ' ', ' ', '11W'],
4239
+ [' ', ' ', ' ', ' ', ' ', '3B', ' ', '3B', ' ', ' ', ' ', ' ', '2B', ' ', ' ', ' ', ' ', ' ', '3W', ' ', ' '],
4240
+ [' ', '2W', ' ', ' ', '2B', ' ', '2W', ' ', '3W', ' ', '2W', '2B', '2B', ' ', ' ', ' ', ' ', ' ', ' ', '8W', ' '],
4241
+ [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '6B', ' ', ' ', ' ', ' ', '4B', '2W', ' ', ' ', ' ', ' ', ' '],
4242
+ [' ', ' ', ' ', '2B', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '2W', ' ', ' ', ' ', '4B', ' ', ' '],
4243
+ [' ', '2B', '2W', ' ', ' ', ' ', '3B', ' ', ' ', ' ', ' ', '3W', ' ', ' ', ' ', ' ', ' ', ' ', '3B', ' ', ' '],
4244
+ ['4W', '3B', ' ', ' ', '3W', ' ', ' ', ' ', ' ', ' ', '3B', ' ', '6B', ' ', ' ', ' ', '2B', ' ', ' ', ' ', ' '],
4245
+ [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '2W', '7B', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
4246
+ [' ', ' ', ' ', '3W', ' ', '3W', '4W', '5B', ' ', ' ', ' ', ' ', '5W', ' ', '4W', ' ', ' ', ' ', '2W', ' ', ' '],
4247
+ ['7B', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '3B', ' '],
4248
+ [' ', ' ', ' ', ' ', '2B', ' ', '4W', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '5B', ' ', ' ', ' '],
4249
+ [' ', ' ', '2W', ' ', ' ', '2B', ' ', '4W', '3W', ' ', ' ', ' ', ' ', ' ', ' ', '5B', '2B', ' ', '3W', ' ', ' '],
4250
+ [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '3B', ' ', '7W', ' ', '2B', '5B', ' ', ' ', ' ', ' ', ' ', ' '],
4251
+ [' ', ' ', ' ', ' ', ' ', '3B', '2B', ' ', ' ', ' ', '3W', ' ', '2B', ' ', ' ', ' ', '2W', ' ', ' ', ' ', ' '],
4252
+ [' ', ' ', ' ', '2W', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '3B', ' '],
4253
+ [' ', '4W', ' ', ' ', '2B', '3B', ' ', ' ', ' ', '2B', '4B', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '3W', ' ', ' '],
4254
+ ['7W', ' ', '3B', ' ', ' ', '2B', ' ', ' ', ' ', '4B', ' ', ' ', ' ', ' ', '2W', '3B', ' ', '2B', ' ', ' ', ' '],
4255
+ [' ', ' ', ' ', '3W', ' ', '3W', ' ', ' ', '2B', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '3W', ' ', '2W', ' ', ' '],
4256
+ [' ', '2B', ' ', ' ', ' ', ' ', '5W', ' ', ' ', ' ', ' ', '5W', ' ', ' ', ' ', '6B', ' ', ' ', ' ', ' ', ' '],
4257
+ ])
4258
+ binst = solver.Board(board=board)
4259
+ solutions = binst.solve_and_print()
4260
+ ```
4261
+
4262
+ **Script Output**
4263
+
4264
+ Note that the solver is much slower for large puzzles like this example and take ~3 minutes to find a valid solution and ~7 minutes to verify that no other solutions exist.
4265
+
4266
+ ```python
4267
+ Solution found
4268
+ 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1
4269
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
4270
+ ┌───────────┐ ┌───────────────────────────┐ ┌───┐ ┌───┐
4271
+ 0 . . . . . │ . . . │ . │ . . . . . . . │ . │ . │ . │ . │
4272
+ ┌───────────────┐ └───┐ ┌───┘ │ ┌───────┐ ┌───────────┘ │ └───┘ │
4273
+ 1│ . . . . │ . . │ . │ . . │ . │ . . │ . │ . . . . │ . . . │
4274
+ └───┐ ┌───────┘ ┌───┘ └───┐ │ └───┐ └───┘ ┌───┐ │ ┌───┐ │
4275
+ 2 . │ . │ . . . │ . . . │ . │ . . │ . . . . │ . │ . │ . │ . │ . │
4276
+ ┌───┘ └───┐ └───────┐ │ │ ┌───┘ ┌───┐ ┌───┘ │ │ │ │ │
4277
+ 3│ . . . │ . . . . │ . │ . │ . │ . . │ . │ . │ . . │ . │ . │ . │ . │
4278
+ └───────┐ └───┐ ┌───────┘ │ │ │ ┌───┘ └───┘ ┌───┘ │ │ │ │
4279
+ 4 . . │ . . │ . │ . . . │ . │ . │ . │ . . . . │ . . │ . │ . │ . │
4280
+ ┌───────┘ ┌───┘ └───────┐ └───┘ └───┘ ┌───────┐ │ └───┘ │ │
4281
+ 5│ . . . │ . . . . │ . . . . . │ . . │ . │ . . . . │ . │
4282
+ └───┐ ┌───┘ ┌───┐ └───────────────────┘ │ └───────────┐ │ │
4283
+ 6 . │ . │ . . . │ . │ . . . . . . . . │ . . . . │ . │ . │
4284
+ ┌───┘ │ ┌───┘ └───────┐ ┌───────────┐ └───┐ ┌───────┘ │ │
4285
+ 7│ . . │ . . │ . . . . │ . . │ . . . │ . . │ . │ . . . │ . │
4286
+ │ ┌───┘ │ ┌───────┐ └───────┘ ┌───┐ │ ┌───┘ └───┐ │ │
4287
+ 8│ . │ . . . │ . │ . . │ . . . . │ . │ . │ . │ . . . │ . . │ . │
4288
+ │ │ │ │ ┌───┘ ┌───────┐ │ │ │ │ ┌───┐ │ │ │
4289
+ 9│ . │ . . . │ . │ . │ . . │ . . │ . │ . │ . │ . │ . │ . │ . │ . . │ . │
4290
+ │ └───────────┘ │ │ ┌───┘ │ │ │ │ │ │ │ └───────┘ │
4291
+ 10│ . . . . . │ . │ . │ . . . │ . │ . │ . │ . │ . │ . │ . . . . │
4292
+ └───────────┐ ┌───┘ │ │ │ │ │ │ │ │ └───────┐ ┌───┘
4293
+ 11 . . . │ . │ . . │ . │ . . . │ . │ . │ . │ . │ . │ . . . │ . │ .
4294
+ ┌───┐ └───┘ │ │ ┌───┐ │ │ │ └───┘ │ ┌───┐ │ │
4295
+ 12│ . │ . . . . . │ . │ . │ . │ . │ . │ . │ . . . │ . │ . │ . │ . │ .
4296
+ │ └───────┐ ┌───┘ │ │ │ │ │ └───┐ └───┘ │ │ └───┐
4297
+ 13│ . . . │ . . │ . . │ . │ . │ . │ . │ . . │ . . . . │ . │ . . │
4298
+ │ ┌───┐ │ └───────┘ │ └───┘ │ ┌───┘ ┌───────┐ │ └───┐ │
4299
+ 14│ . │ . │ . │ . . . . . │ . . . │ . │ . . │ . . │ . │ . . │ . │
4300
+ │ │ │ └───────┐ ┌───┐ └───────────┘ └───┐ │ │ │ ┌───┘ │
4301
+ 15│ . │ . │ . . . │ . │ . │ . . . . . . │ . │ . . │ . │ . │ . . │
4302
+ │ │ └───────┐ └───┘ │ ┌───┐ │ │ └───┘ │ ┌───┘
4303
+ 16│ . │ . . . │ . . . │ . . │ . │ . . . │ . │ . . . . │ . │ .
4304
+ │ │ ┌───┘ ┌───────┘ ┌───┘ └───────────┘ └───┐ ┌───┐ │ │
4305
+ 17│ . │ . . │ . . │ . . . │ . . . . . . . │ . │ . │ . │ . │ .
4306
+ │ └───┐ │ ┌───┘ ┌───┘ ┌───────────┐ ┌───────┘ │ └───┘ └───┐
4307
+ 18│ . . │ . │ . │ . . . │ . . │ . . . │ . │ . . . │ . . . . │
4308
+ └───┐ │ │ └───────────┘ ┌───┘ ┌───────┘ └───────┐ │ ┌───────┐ │
4309
+ 19 . │ . │ . │ . . . . . │ . . │ . . . . . │ . │ . │ . . │ . │
4310
+ └───┘ └───────────────────┘ └───────────────────┘ └───┘ └───┘
4311
+ Solutions found: 1
4312
+ status: OPTIMAL
4313
+ Time taken: 425.97 seconds
4314
+ ```
4315
+
4316
+ **Solved puzzle**
4317
+
4318
+ <img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/shingoki_solved.png" alt="Shingoki solved" width="500">
4319
+
4320
+ ---
4321
+
4322
+ ## Tapa (Puzzle Type #48)
4323
+
4324
+ * [**Play online**](https://www.puzzle-tapa.com/)
4325
+
4326
+ * [**Instructions**](https://www.gmpuzzles.com/blog/tapa-rules-and-info/)
4327
+
4328
+ * [**Solver Code**][48]
4329
+
4330
+ <details>
4331
+ <summary><strong>Rules</strong></summary>
4332
+
4333
+ You are given a grid where some cells have numbers. Your goal is to shade some cells black to satisfy the following rules:
4334
+
4335
+ - Cells with numbers cannot be shaded
4336
+ - The shaded cells cannot form a 2×2 square
4337
+ - Numbers in a cell indicate the length of consecutive shaded blocks in the neighboring cells. If there is more than one number in a cell, then there must be at least one white (unshaded) cell between the black cell groups.
4338
+ - The shaded cells should form a single connected area.
4339
+ - The numbers in a cell represent the length of consecutive shaded blocks in the 8 neighboring cells.
4340
+ - A single number N represents N consecutive shaded cells around the number.
4341
+ - Multiple numbers represent multiple consecutive shaded cells around the number, each separated by at least one white cell.
4342
+
4343
+ </details>
4344
+
4345
+ **Unsolved puzzle**
4346
+
4347
+ <img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/tapa_unsolved.png" alt="Tapa unsolved" width="500">
4348
+
4349
+ Code to utilize this package and solve the puzzle:
4350
+
4351
+ ```python
4352
+ import numpy as np
4353
+ from puzzle_solver import tapa_solver as solver
4354
+ board = np.array([
4355
+ [' ', ' ', ' ', ' ', ' ', '3 ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '3 ', ' ', ' ', ' ', ' ', ' '],
4356
+ [' ', ' ', ' ', ' ', '2/3', ' ', ' ','1/2/2',' ', '3/3', '7 ', ' ', '7 ', ' ', ' ', '2/3', ' ', ' ', ' ', ' '],
4357
+ [' ', '2/4', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '2/3', ' '],
4358
+ [' ', ' ', ' ', '1/3','1/1/2',' ', ' ', '7 ', ' ', ' ', ' ', ' ', '7 ', ' ',' ','1/1/1/1','1/3',' ', ' ', ' '],
4359
+ [' ', ' ','1/1/3',' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '1/4', ' ', ' '],
4360
+
4361
+ [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ','1/1/3','1/2', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
4362
+ [' ', ' ', '5 ', ' ', ' ','1/1/1','1/1', ' ', ' ', ' ', ' ', ' ', ' ', '1/3', '2/3', ' ', ' ', '3/3', ' ', ' '],
4363
+ [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
4364
+
4365
+ [' ', ' ','1/1/2',' ', ' ', ' ', ' ', ' ', '7 ', '3/3', '3/3', '2/4', ' ', ' ', ' ', ' ', ' ', '6 ', ' ', ' '],
4366
+ [' ', '1/4', ' ', ' ', '2/3', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '2/4', ' ', ' ', '1/3', ' '],
4367
+ [' ', '1/3', ' ', ' ', '1/4', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '2/3', ' ', ' ','1/1/2',' '],
4368
+ [' ', ' ', '6 ', ' ', ' ', ' ', ' ', ' ', '1/1', '1/2','1/1/2','1/4', ' ', ' ', ' ', ' ', ' ', '6 ', ' ', ' '],
4369
+ [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
4370
+
4371
+ [' ', ' ', '3/3', ' ', ' ', '1/2', '1/1', ' ', ' ', ' ', ' ', ' ', ' ', '1/3','1/1/3',' ', ' ', '2/3', ' ', ' '],
4372
+ [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '4 ', '1/3', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
4373
+ [' ', ' ', '1/4', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '1/3', ' ', ' '],
4374
+
4375
+ [' ', ' ', ' ', '1/3','1/1/3',' ', ' ', '6 ', ' ', ' ', ' ', ' ', '7 ', ' ', ' ','1/1/2','1/3', ' ', ' ', ' '],
4376
+ [' ', '2/3', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '2/3', ' '],
4377
+ [' ', ' ', ' ', ' ', '2/3', ' ', ' ', '6 ', ' ', '1/3', '4 ', ' ', '6 ', ' ', ' ', '2/3', ' ', ' ', ' ', ' '],
4378
+ [' ', ' ', ' ', ' ', ' ', '1/1', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '1/1', ' ', ' ', ' ', ' ', ' '],
4379
+ ])
4380
+ binst = solver.Board(board=board)
4381
+ solutions = binst.solve_and_print()
4382
+ ```
4383
+
4384
+ **Script Output**
4385
+
4386
+ ```python
4387
+ Solution found
4388
+ 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1
4389
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
4390
+ ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐
4391
+ 0│ │▒▒▒│▒▒▒│▒▒▒│ │ 3 │▒▒▒│ │▒▒▒│▒▒▒│▒▒▒│▒▒▒│▒▒▒│▒▒▒│ 3 │ │▒▒▒│▒▒▒│▒▒▒│▒▒▒│
4392
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4393
+ 1│▒▒▒│▒▒▒│ │▒▒▒│2/3│▒▒▒│▒▒▒│...│ │3/3│ 7 │▒▒▒│ 7 │▒▒▒│▒▒▒│2/3│▒▒▒│ │ │▒▒▒│
4394
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4395
+ 2│▒▒▒│2/4│▒▒▒│▒▒▒│ │▒▒▒│ │▒▒▒│▒▒▒│▒▒▒│▒▒▒│▒▒▒│▒▒▒│ │▒▒▒│ │▒▒▒│▒▒▒│2/3│▒▒▒│
4396
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4397
+ 3│▒▒▒│ │▒▒▒│1/3│...│▒▒▒│▒▒▒│ 7 │▒▒▒│ │ │▒▒▒│ 7 │▒▒▒│ │...│1/3│▒▒▒│ │▒▒▒│
4398
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4399
+ 4│▒▒▒│▒▒▒│...│▒▒▒│ │ │▒▒▒│▒▒▒│▒▒▒│ │▒▒▒│▒▒▒│▒▒▒│▒▒▒│▒▒▒│ │▒▒▒│1/4│ │▒▒▒│
4400
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4401
+ 5│▒▒▒│ │▒▒▒│▒▒▒│▒▒▒│ │▒▒▒│ │▒▒▒│...│1/2│ │ │ │▒▒▒│▒▒▒│▒▒▒│▒▒▒│▒▒▒│▒▒▒│
4402
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4403
+ 6│▒▒▒│ │ 5 │▒▒▒│ │...│1/1│ │▒▒▒│ │▒▒▒│ │ │1/3│2/3│▒▒▒│ │3/3│ │▒▒▒│
4404
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4405
+ 7│▒▒▒│ │▒▒▒│▒▒▒│▒▒▒│ │ │▒▒▒│▒▒▒│▒▒▒│▒▒▒│▒▒▒│▒▒▒│▒▒▒│▒▒▒│ │▒▒▒│▒▒▒│▒▒▒│▒▒▒│
4406
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4407
+ 8│▒▒▒│▒▒▒│...│ │▒▒▒│▒▒▒│ │▒▒▒│ 7 │3/3│3/3│2/4│▒▒▒│ │ │▒▒▒│▒▒▒│ 6 │ │▒▒▒│
4408
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4409
+ 9│▒▒▒│1/4│ │▒▒▒│2/3│▒▒▒│▒▒▒│▒▒▒│▒▒▒│▒▒▒│▒▒▒│▒▒▒│ │ │▒▒▒│2/4│▒▒▒│▒▒▒│1/3│▒▒▒│
4410
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4411
+ 10│▒▒▒│1/3│▒▒▒│▒▒▒│1/4│ │▒▒▒│ │ │▒▒▒│ │▒▒▒│▒▒▒│▒▒▒│▒▒▒│2/3│▒▒▒│ │...│▒▒▒│
4412
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4413
+ 11│▒▒▒│ │ 6 │▒▒▒│▒▒▒│ │▒▒▒│ │1/1│1/2│...│1/4│▒▒▒│ │ │ │▒▒▒│ 6 │▒▒▒│ │
4414
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4415
+ 12│▒▒▒│▒▒▒│▒▒▒│▒▒▒│ │ │▒▒▒│ │ │▒▒▒│▒▒▒│ │▒▒▒│▒▒▒│ │▒▒▒│▒▒▒│▒▒▒│▒▒▒│▒▒▒│
4416
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4417
+ 13│▒▒▒│ │3/3│ │ │1/2│1/1│ │▒▒▒│▒▒▒│ │▒▒▒│▒▒▒│1/3│...│▒▒▒│ │2/3│ │▒▒▒│
4418
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4419
+ 14│▒▒▒│▒▒▒│▒▒▒│▒▒▒│▒▒▒│▒▒▒│ │ │▒▒▒│ 4 │1/3│▒▒▒│ │▒▒▒│ │▒▒▒│▒▒▒│▒▒▒│ │▒▒▒│
4420
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4421
+ 15│▒▒▒│ │1/4│▒▒▒│ │▒▒▒│▒▒▒│▒▒▒│▒▒▒│ │ │▒▒▒│▒▒▒│▒▒▒│ │ │▒▒▒│1/3│ │▒▒▒│
4422
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4423
+ 16│▒▒▒│ │▒▒▒│1/3│...│▒▒▒│ │ 6 │▒▒▒│▒▒▒│▒▒▒│▒▒▒│ 7 │▒▒▒│▒▒▒│...│1/3│▒▒▒│ │▒▒▒│
4424
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4425
+ 17│▒▒▒│2/3│▒▒▒│▒▒▒│ │▒▒▒│ │▒▒▒│▒▒▒│ │ │▒▒▒│▒▒▒│ │▒▒▒│ │▒▒▒│▒▒▒│2/3│▒▒▒│
4426
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4427
+ 18│▒▒▒│ │ │▒▒▒│2/3│▒▒▒│ │ 6 │▒▒▒│1/3│ 4 │▒▒▒│ 6 │ │▒▒▒│2/3│▒▒▒│ │ │▒▒▒│
4428
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4429
+ 19│▒▒▒│▒▒▒│▒▒▒│▒▒▒│ │1/1│▒▒▒│▒▒▒│▒▒▒│ │▒▒▒│▒▒▒│▒▒▒│▒▒▒│1/1│ │▒▒▒│▒▒▒│▒▒▒│▒▒▒│
4430
+ └───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┘
4431
+ Solutions found: 1
4432
+ status: OPTIMAL
4433
+ Time taken: 14.20 seconds
4434
+ ```
4435
+
4436
+ **Solved puzzle**
4437
+
4438
+ <img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/tapa_solved.png" alt="Tapa solved" width="500">
4439
+
4440
+ ---
4441
+
4442
+ ## Binairo Plus (Puzzle Type #49)
4443
+
4444
+ * [**Play online**](https://www.puzzle-binairo.com/binairo-plus-6x6-easy/)
4445
+
4446
+ * [**Solver Code**][49]
4447
+
4448
+ <details>
4449
+ <summary><strong>Rules</strong></summary>
4450
+
4451
+ 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:
4452
+ 1. Each row and each column must contain an equal number of white and black circles.
4453
+ 2. More than two circles of the same color can't be adjacent.
4454
+ 3. Two cells with a "=" sign between them should contain circles of the same type.
4455
+ 4. Two cells with a "x" sign between them should contain circles of the opposite type.
4456
+
4457
+ </details>
4458
+
4459
+ **Unsolved puzzle**
4460
+
4461
+ <img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/binairo_plus_unsolved.png" alt="Binairo Plus unsolved" width="500">
4462
+
4463
+ Code to utilize this package and solve the puzzle:
4464
+
4465
+ ```python
4466
+ import numpy as np
4467
+ from puzzle_solver import binairo_plus_solver as solver
4468
+ board = np.array([
4469
+ [' ', ' ', 'W', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'B', ' ', ' '],
4470
+ ['B', ' ', ' ', ' ', 'W', ' ', ' ', ' ', ' ', 'B', ' ', ' ', ' ', 'B'],
4471
+ [' ', ' ', ' ', ' ', ' ', 'W', ' ', ' ', 'W', ' ', ' ', ' ', ' ', ' '],
4472
+ ['B', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'W'],
4473
+ [' ', ' ', ' ', 'B', ' ', ' ', ' ', ' ', ' ', ' ', 'B', ' ', ' ', ' '],
4474
+ ['W', ' ', 'B', ' ', 'W', ' ', ' ', ' ', ' ', 'W', ' ', 'B', ' ', 'B'],
4475
+ [' ', ' ', 'W', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'B', ' ', ' '],
4476
+ [' ', ' ', 'B', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'W', ' ', ' '],
4477
+ ['B', ' ', 'W', ' ', 'B', ' ', ' ', ' ', ' ', 'W', ' ', 'W', ' ', 'B'],
4478
+ [' ', ' ', ' ', 'B', ' ', ' ', ' ', ' ', ' ', ' ', 'W', ' ', ' ', ' '],
4479
+ ['W', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'B'],
4480
+ [' ', ' ', ' ', ' ', ' ', 'W', ' ', ' ', 'W', ' ', ' ', ' ', ' ', ' '],
4481
+ ['W', ' ', ' ', ' ', 'W', ' ', ' ', ' ', ' ', 'B', ' ', ' ', ' ', 'W'],
4482
+ [' ', ' ', 'B', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'W', ' ', ' '],
4483
+ ])
4484
+ # between cells horizontally
4485
+ arith_rows = np.array([
4486
+ [' ', ' ', ' ', '=', ' ', 'x', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
4487
+ [' ', ' ', ' ', ' ', ' ', ' ', '=', ' ', ' ', ' ', ' ', ' ', ' '],
4488
+ [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
4489
+ [' ', ' ', ' ', ' ', ' ', ' ', 'x', ' ', ' ', ' ', ' ', ' ', ' '],
4490
+ [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
4491
+ [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
4492
+ ['x', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
4493
+ [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
4494
+ [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
4495
+ [' ', ' ', ' ', ' ', ' ', ' ', '=', ' ', ' ', ' ', ' ', ' ', ' '],
4496
+ [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
4497
+ [' ', ' ', '=', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '=', ' '],
4498
+ [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
4499
+ [' ', ' ', ' ', 'x', 'x', ' ', ' ', ' ', 'x', ' ', ' ', ' ', ' '],
4500
+ ])
4501
+ # between cells vertically
4502
+ arith_cols = np.array([
4503
+ [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
4504
+ [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
4505
+ [' ', ' ', ' ', ' ', '=', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
4506
+ [' ', ' ', ' ', ' ', ' ', ' ', ' ', '=', ' ', '=', ' ', ' ', 'x', ' '],
4507
+ [' ', ' ', ' ', ' ', ' ', ' ', ' ', 'x', ' ', ' ', ' ', ' ', ' ', ' '],
4508
+ [' ', ' ', ' ', ' ', ' ', ' ', ' ', 'x', '=', ' ', '=', ' ', ' ', ' '],
4509
+ [' ', ' ', ' ', ' ', ' ', '=', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
4510
+ [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '=', ' ', ' ', ' '],
4511
+ [' ', ' ', ' ', ' ', ' ', ' ', '=', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
4512
+ [' ', ' ', ' ', ' ', ' ', ' ', ' ', '=', ' ', ' ', ' ', ' ', ' ', ' '],
4513
+ [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
4514
+ [' ', 'x', ' ', ' ', ' ', ' ', ' ', 'x', ' ', ' ', ' ', ' ', ' ', ' '],
4515
+ [' ', ' ', ' ', ' ', ' ', ' ', '=', ' ', 'x', ' ', ' ', ' ', 'x', ' '],
4516
+ ])
4517
+ binst = solver.Board(board=board, arith_rows=arith_rows, arith_cols=arith_cols)
4518
+ solutions = binst.solve_and_print()
4519
+ ```
4520
+
4521
+ **Script Output**
4522
+
4523
+ ```python
4524
+ Solution found
4525
+ 0 0 0 0 0 0 0 0 0 0 1 1 1 1
4526
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3
4527
+ ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐
4528
+ 0│▒▒▒│ │ │▒▒▒│▒▒▒│ │▒▒▒│▒▒▒│ │ │▒▒▒│▒▒▒│ │ │
4529
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4530
+ 1│▒▒▒│ │ │▒▒▒│ │▒▒▒│ │ │▒▒▒│▒▒▒│ │ │▒▒▒│▒▒▒│
4531
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4532
+ 2│ │▒▒▒│▒▒▒│ │▒▒▒│ │ │▒▒▒│ │ │▒▒▒│ │▒▒▒│▒▒▒│
4533
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4534
+ 3│▒▒▒│▒▒▒│ │ │▒▒▒│ │▒▒▒│ │▒▒▒│▒▒▒│ │▒▒▒│ │ │
4535
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4536
+ 4│▒▒▒│ │ │▒▒▒│ │▒▒▒│▒▒▒│ │ │▒▒▒│▒▒▒│ │▒▒▒│ │
4537
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4538
+ 5│ │▒▒▒│▒▒▒│ │ │▒▒▒│ │▒▒▒│▒▒▒│ │ │▒▒▒│ │▒▒▒│
4539
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4540
+ 6│ │▒▒▒│ │ │▒▒▒│ │▒▒▒│ │▒▒▒│▒▒▒│ │▒▒▒│▒▒▒│ │
4541
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4542
+ 7│▒▒▒│ │▒▒▒│▒▒▒│ │ │▒▒▒│▒▒▒│ │ │▒▒▒│ │▒▒▒│ │
4543
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4544
+ 8│▒▒▒│▒▒▒│ │ │▒▒▒│▒▒▒│ │▒▒▒│ │ │▒▒▒│ │ │▒▒▒│
4545
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4546
+ 9│ │ │▒▒▒│▒▒▒│ │▒▒▒│ │ │▒▒▒│▒▒▒│ │▒▒▒│▒▒▒│ │
4547
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4548
+ 10│ │▒▒▒│▒▒▒│ │▒▒▒│ │▒▒▒│ │▒▒▒│ │ │▒▒▒│ │▒▒▒│
4549
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4550
+ 11│▒▒▒│▒▒▒│ │ │▒▒▒│ │▒▒▒│▒▒▒│ │ │▒▒▒│ │ │▒▒▒│
4551
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4552
+ 12│ │ │▒▒▒│▒▒▒│ │▒▒▒│ │ │▒▒▒│▒▒▒│ │▒▒▒│▒▒▒│ │
4553
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4554
+ 13│ │ │▒▒▒│▒▒▒│ │▒▒▒│ │▒▒▒│ │▒▒▒│▒▒▒│ │ │▒▒▒│
4555
+ └───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┘
4556
+ Solutions found: 1
4557
+ status: OPTIMAL
4558
+ Time taken: 0.00 seconds
4559
+ ```
4560
+
4561
+ **Solved puzzle**
4562
+
4563
+ <img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/binairo_plus_solved.png" alt="Binairo Plus solved" width="500">
4564
+
4565
+ ---
4566
+
4567
+ ## Shakashaka (Puzzle Type #50)
4568
+
4569
+ Also called "Proof of Quilt"
4570
+
4571
+ * [**Play online**](https://www.puzzle-shakashaka.com/)
4572
+
4573
+ * [**Solver Code**][50]
4574
+
4575
+ <details>
4576
+ <summary><strong>Rules</strong></summary>
4577
+
4578
+ Shakashaka is played on a rectangular grid. The grid has both black cells and white cells in it.
4579
+ The objective is to place black triangles in the white cell in such a way so that they form white rectangular (or square) areas.
4580
+ - The triangles are right angled and occupy half of the white square divided diagonally.
4581
+ - You can place triangles only in white cells
4582
+ - The numbers in the black cells indicate how many triangles are adjacent, vertically and horizontally.
4583
+ - The white rectangles can be either straight or rotated at 45°
4584
+
4585
+ </details>
4586
+
4587
+ **Unsolved puzzle**
4588
+
4589
+ <img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/shakashaka_unsolved.png" alt="Shakashaka unsolved" width="500">
4590
+
4591
+ Code to utilize this package and solve the puzzle:
4592
+
4593
+ ```python
4594
+ import numpy as np
4595
+ from puzzle_solver import shakashaka_solver as solver
4596
+ board = np.array([
4597
+ [' ', ' ', 'B', ' ', '1', ' ', ' ', '1', ' ', ' ', 'B', 'B', ' ', ' ', ' ', '2', ' ', ' ', ' ', ' ', 'B', ' ', 'B', ' ', ' '],
4598
+ [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'B', ' ', ' ', ' ', ' ', 'B', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
4599
+ [' ', ' ', ' ', ' ', ' ', ' ', ' ', '3', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '4', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
4600
+ [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'B', ' ', ' ', ' ', ' ', ' ', ' ', '3', ' ', ' ', ' ', ' ', ' ', 'B'],
4601
+ ['1', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '2', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '4', ' ', ' ', ' ', ' '],
4602
+ [' ', ' ', '3', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'B', ' ', ' '],
4603
+ [' ', ' ', ' ', '1', ' ', ' ', '2', ' ', ' ', ' ', ' ', 'B', ' ', '3', ' ', ' ', ' ', 'B', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
4604
+ [' ', ' ', ' ', 'B', ' ', ' ', 'B', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '3', ' ', ' ', ' ', '4', ' ', ' ', ' ', 'B'],
4605
+ [' ', 'B', '2', ' ', ' ', 'B', ' ', ' ', ' ', ' ', '3', ' ', ' ', ' ', '2', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '4', ' ', ' '],
4606
+ ['B', ' ', ' ', ' ', ' ', 'B', ' ', ' ', '1', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
4607
+ ['0', ' ', ' ', 'B', ' ', ' ', ' ', ' ', 'B', ' ', ' ', ' ', 'B', 'B', 'B', ' ', ' ', ' ', ' ', '3', ' ', ' ', ' ', ' ', 'B'],
4608
+ ['0', ' ', ' ', 'B', ' ', ' ', ' ', 'B', ' ', ' ', ' ', '1', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '3', ' '],
4609
+ [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '2', ' ', 'B', ' ', ' ', 'B', ' ', ' ', ' ', ' ', ' ', 'B', ' ', ' ', ' '],
4610
+ [' ', ' ', ' ', ' ', ' ', 'B', ' ', ' ', 'B', ' ', 'B', ' ', 'B', ' ', 'B', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
4611
+ [' ', ' ', ' ', ' ', '4', ' ', ' ', '3', ' ', 'B', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'B', ' ', ' ', '4', ' ', ' ', ' ', ' '],
4612
+ [' ', 'B', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'B', ' ', ' ', ' ', ' ', '3', ' ', ' ', 'B', ' ', ' ', ' ', ' ', ' ', '3'],
4613
+ ['B', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'B', ' ', ' ', ' ', '1', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '4', ' ', ' ', ' '],
4614
+ [' ', ' ', 'B', ' ', 'B', ' ', ' ', '2', ' ', ' ', ' ', ' ', ' ', 'B', ' ', ' ', 'B', ' ', ' ', 'B', ' ', ' ', ' ', ' ', ' '],
4615
+ [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '0', ' ', ' ', ' ', ' ', ' ', 'B', ' ', ' '],
4616
+ ['B', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'B', ' ', ' ', ' ', ' ', ' ', ' ', 'B', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
4617
+ [' ', ' ', ' ', ' ', ' ', ' ', '2', 'B', ' ', ' ', '2', ' ', ' ', ' ', ' ', 'B', ' ', ' ', ' ', ' ', '1', ' ', ' ', ' ', ' '],
4618
+ [' ', ' ', ' ', '3', ' ', ' ', ' ', '2', ' ', ' ', '1', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'B', ' ', 'B', ' ', ' ', ' ', ' '],
4619
+ [' ', ' ', 'B', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'B', ' ', ' ', ' ', 'B', ' ', ' ', 'B', ' ', ' ', ' ', ' ', ' ', ' ', '2'],
4620
+ ['2', ' ', ' ', 'B', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '3', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'B', ' ', ' ', ' ', ' '],
4621
+ [' ', ' ', ' ', ' ', ' ', ' ', '3', ' ', ' ', ' ', ' ', ' ', '2', ' ', ' ', ' ', ' ', '0', ' ', ' ', ' ', ' ', ' ', '2', ' '],
4622
+ ])
4623
+ binst = solver.Board(board=board)
4624
+ solutions = binst.solve_and_print()
4625
+ ```
4626
+
4627
+ **Script Output**
4628
+
4629
+ (Note: It took so long to find a good text-based visualization to the solution that is both readable and looks good, this isn't the best but it finally does the job)
4630
+
4631
+ ```python
4632
+ Solution found
4633
+ ┌──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┐
4634
+ │ /│\ │ │██████│ │ /│\ │ │██████│██████│ │ │██████│ /│\ │ │██████│ /│\ │██████│ │██████│ │ /│\ │
4635
+ │ /███│██\ │ . │██████│ 1 │ /███│██\ │ 1 │██████│██████│ . │ . │██████│ /███│██\ │ 2 │██████│ /███│██\ │██████│ . │██████│ . │ /███│██\ │
4636
+ │/█████│█████\│ │██████│ │/█████│█████\│ │██████│██████│ │ │██████│/█████│█████\│ │██████│/█████│█████\│██████│ │██████│ │/█████│█████\│
4637
+ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4638
+ │\█████│█████/│ /│\ │██████│\█████│█████/│██████│ /│\ │██████│ │██████│\█████│██████│\ │ │\█████│██████│\ │██████│ /│\ │\█████│█████/│
4639
+ │ \███│██/ │ /███│██\ │██████│ \███│██/ │██████│ /███│██\ │██████│ . │██████│ \███│██████│██\ │ . │ \███│██████│██\ │██████│ /███│██\ │ \███│██/ │
4640
+ │ \│/ │/█████│█████\│██████│ \│/ │██████│/█████│█████\│██████│ │██████│ \│██████│█████\│ │ \│██████│█████\│██████│/█████│█████\│ \│/ │
4641
+ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4642
+ │██████│ /│██████│██████│\ │ /│\ │ │\█████│██████│\ │██████│ /│\ │\█████│██████│\ │ │\█████│█████/│ /│██████│██████│\ │██████│
4643
+ │██████│ /███│██████│██████│██\ │ /███│██\ │ 3 │ \███│██████│██\ │██████│ /███│██\ │ \███│██████│██\ │ 4 │ \███│██/ │ /███│██████│██████│██\ │██████│
4644
+ │██████│/█████│██████│██████│█████\│/█████│█████\│ │ \│██████│█████\│██████│/█████│█████\│ \│██████│█████\│ │ \│/ │/█████│██████│██████│█████\│██████│
4645
+ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4646
+ │██████│\█████│██████│██████│█████/│\█████│█████/│ /│\ │\█████│█████/│ │\█████│█████/│██████│\█████│██████│\ │ │██████│\█████│██████│██████│█████/│ │
4647
+ │██████│ \███│██████│██████│██/ │ \███│██/ │ /███│██\ │ \███│██/ │ . │ \███│██/ │██████│ \███│██████│██\ │ 3 │██████│ \███│██████│██████│██/ │ . │
4648
+ │██████│ \│██████│██████│/ │ \│/ │/█████│█████\│ \│/ │ │ \│/ │██████│ \│██████│█████\│ │██████│ \│██████│██████│/ │ │
4649
+ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4650
+ │ │██████│\█████│█████/│ /│\ │ /│██████│█████/│██████│ │ /│\ │ /│\ │██████│\█████│█████/│ /│\ │ │\█████│█████/│██████│██████│
4651
+ │ 1 │██████│ \███│██/ │ /███│██\ │ /███│██████│██/ │██████│ 2 │ /███│██\ │ /███│██\ │██████│ \███│██/ │ /███│██\ │ 4 │ \███│██/ │██████│██████│
4652
+ │ │██████│ \│/ │/█████│█████\│/█████│██████│/ │██████│ │/█████│█████\│/█████│█████\│██████│ \│/ │/█████│█████\│ │ \│/ │██████│██████│
4653
+ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4654
+ │ /│\ │ │██████│\█████│█████/│\█████│█████/│ /│\ │██████│\█████│█████/│\█████│█████/│ /│\ │██████│\█████│█████/│ /│\ │ │ /│\ │
4655
+ │ /███│██\ │ 3 │██████│ \███│██/ │ \███│██/ │ /███│██\ │██████│ \███│██/ │ \███│██/ │ /███│██\ │██████│ \███│██/ │ /███│██\ │ . │ /███│██\ │
4656
+ │/█████│█████\│ │██████│ \│/ │ \│/ │/█████│█████\│██████│ \│/ │ \│/ │/█████│█████\│██████│ \│/ │/█████│█████\│ │/█████│█████\│
4657
+ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4658
+ │\█████│██████│\ │ │██████│██████│ │ /│██████│██████│\ │ │██████│ │ /│██████│█████/│ │ /│\ │\█████│██████│\ │\█████│█████/│
4659
+ │ \███│██████│██\ │ 1 │██████│██████│ 2 │ /███│██████│██████│██\ │ . │██████│ 3 │ /███│██████│██/ │ . │ /███│██\ │ \███│██████│██\ │ \███│██/ │
4660
+ │ \│██████│█████\│ │██████│██████│ │/█████│██████│██████│█████\│ │██████│ │/█████│██████│/ │ │/█████│█████\│ \│██████│█████\│ \│/ │
4661
+ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4662
+ │██████│\█████│█████/│ │██████│██████│ │\█████│██████│██████│█████/│██████│ /│\ │\█████│█████/│ │██████│\█████│█████/│ │\█████│█████/│██████│ │
4663
+ │██████│ \███│██/ │ . │██████│██████│ . │ \███│██████│██████│██/ │██████│ /███│██\ │ \███│██/ │ 3 │██████│ \███│██/ │ 4 │ \███│██/ │██████│ . │
4664
+ │██████│ \│/ │ │██████│██████│ │ \│██████│██████│/ │██████│/█████│█████\│ \│/ │ │██████│ \│/ │ │ \│/ │██████│ │
4665
+ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4666
+ │██████│ │ │ /│\ │ │██████│██████│\█████│█████/│ │ /│██████│█████/│ │██████│ /│\ │ /│\ │ /│\ │ │ /│\ │
4667
+ │██████│ . │ 2 │ /███│██\ │ . │██████│██████│ \███│██/ │ 3 │ /███│██████│██/ │ 2 │██████│ /███│██\ │ /███│██\ │ /███│██\ │ 4 │ /███│██\ │
4668
+ │██████│ │ │/█████│█████\│ │██████│██████│ \│/ │ │/█████│██████│/ │ │██████│/█████│█████\│/█████│█████\│/█████│█████\│ │/█████│█████\│
4669
+ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4670
+ │ │██████│██████│\█████│█████/│ │██████│██████│ │██████│██████│\█████│█████/│██████│██████│ /│██████│█████/│\█████│█████/│\█████│█████/│ /│██████│█████/│
4671
+ │ . │██████│██████│ \███│██/ │ . │██████│██████│ 1 │██████│██████│ \███│██/ │██████│██████│ /███│██████│██/ │ \███│██/ │ \███│██/ │ /███│██████│██/ │
4672
+ │ │██████│██████│ \│/ │ │██████│██████│ │██████│██████│ \│/ │██████│██████│/█████│██████│/ │ \│/ │ \│/ │/█████│██████│/ │
4673
+ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4674
+ │ │██████│██████│ │ /│\ │██████│██████│ │ /│\ │██████│ │ │ │\█████│█████/│ /│\ │ │██████│ /│██████│█████/│ │
4675
+ │ 0 │██████│██████│ . │ /███│██\ │██████│██████│ . │ /███│██\ │██████│ . │ . │ . │ \███│██/ │ /███│██\ │ 3 │██████│ /███│██████│██/ │ . │
4676
+ │ │██████│██████│ │/█████│█████\│██████│██████│ │/█████│█████\│██████│ │ │ │ \│/ │/█████│█████\│ │██████│/█████│██████│/ │ │
4677
+ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4678
+ │ │██████│██████│ │\█████│██████│\ │ │ /│██████│█████/│ │██████│ /│\ │██████│ /│██████│██████│\ │██████│\█████│█████/│ │██████│
4679
+ │ 0 │██████│██████│ . │ \███│██████│██\ │ . │ /███│██████│██/ │ 1 │██████│ /███│██\ │██████│ /███│██████│██████│██\ │██████│ \███│██/ │ 3 │██████│
4680
+ │ │██████│██████│ │ \│██████│█████\│ │/█████│██████│/ │ │██████│/█████│█████\│██████│/█████│██████│██████│█████\│██████│ \│/ │ │██████│
4681
+ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4682
+ │██████│ /│\ │ /│\ │\█████│██████│\ │\█████│█████/│ │██████│ │\█████│█████/│ │\█████│██████│██████│██████│\ │ │ /│\ │██████│
4683
+ │██████│ /███│██\ │ /███│██\ │ \███│██████│██\ │ \███│██/ │ 2 │██████│ . │ \███│██/ │ . │ \███│██████│██████│██████│██\ │ . │ /███│██\ │██████│
4684
+ │██████│/█████│█████\│/█████│█████\│ \│██████│█████\│ \│/ │ │██████│ │ \│/ │ │ \│██████│██████│██████│█████\│ │/█████│█████\│██████│
4685
+ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4686
+ │ /│██████│█████/│\█████│█████/│ │\█████│█████/│ │██████│ │██████│ │██████│ │ /│\ │\█████│██████│██████│█████/│██████│\█████│██████│\ │
4687
+ │ /███│██████│██/ │ \███│██/ │ . │ \███│██/ │ . │██████│ . │██████│ . │██████│ . │ /███│██\ │ \███│██████│██████│██/ │██████│ \███│██████│██\ │
4688
+ │/█████│██████│/ │ \│/ │ │ \│/ │ │██████│ │██████│ │██████│ │/█████│█████\│ \│██████│██████│/ │██████│ \│██████│█████\│
4689
+ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4690
+ │\█████│█████/│ /│\ │ │ /│\ │ │██████│ │██████│ /│\ │ /│\ │\█████│█████/│ │\█████│█████/│ │ /│\ │\█████│█████/│
4691
+ │ \███│██/ │ /███│██\ │ 4 │ /███│██\ │ 3 │██████│ . │██████│ /███│██\ │ /███│██\ │ \███│██/ │ . │ \███│██/ │ 4 │ /███│██\ │ \███│██/ │
4692
+ │ \│/ │/█████│█████\│ │/█████│█████\│ │██████│ │██████│/█████│█████\│/█████│█████\│ \│/ │ │ \│/ │ │/█████│█████\│ \│/ │
4693
+ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4694
+ │██████│ │\█████│██████│\ │\█████│█████/│ /│\ │██████│ │\█████│█████/│\█████│█████/│ │ /│\ │ │ /│\ │\█████│██████│\ │ │
4695
+ │██████│ . │ \███│██████│██\ │ \███│██/ │ /███│██\ │██████│ . │ \███│██/ │ \███│██/ │ 3 │ /███│██\ │ . │ /███│██\ │ \███│██████│██\ │ 3 │
4696
+ │██████│ │ \│██████│█████\│ \│/ │/█████│█████\│██████│ │ \│/ │ \│/ │ │/█████│█████\│ │/█████│█████\│ \│██████│█████\│ │
4697
+ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4698
+ │ │██████│██████│\█████│█████/│██████│██████│\█████│█████/│ │ /│\ │██████│ │██████│██████│\█████│██████│\ │\█████│█████/│ │\█████│██████│\ │
4699
+ │ . │██████│██████│ \███│██/ │██████│██████│ \███│██/ │ . │ /███│██\ │██████│ 1 │██████│██████│ \███│██████│██\ │ \███│██/ │ 4 │ \███│██████│██\ │
4700
+ │ │██████│██████│ \│/ │██████│██████│ \│/ │ │/█████│█████\│██████│ │██████│██████│ \│██████│█████\│ \│/ │ │ \│██████│█████\│
4701
+ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4702
+ │ /│\ │ │██████│ │██████│██████│ │██████│ /│██████│██████│\ │ │██████│██████│ │\█████│█████/│ │ /│\ │██████│\█████│█████/│
4703
+ │ /███│██\ │ . │██████│ . │██████│██████│ 2 │██████│ /███│██████│██████│██\ │ . │██████│██████│ . │ \███│██/ │ . │ /███│██\ │██████│ \███│██/ │
4704
+ │/█████│█████\│ │██████│ │██████│██████│ │██████│/█████│██████│██████│█████\│ │██████│██████│ │ \│/ │ │/█████│█████\│██████│ \│/ │
4705
+ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4706
+ │\█████│█████/│██████│ /│\ │██████│██████│ /│\ │\█████│██████│██████│██████│\ │██████│██████│ │██████│ /│\ │\█████│█████/│ │ /│\ │
4707
+ │ \███│██/ │██████│ /███│██\ │██████│██████│ /███│██\ │ \███│██████│██████│██████│██\ │██████│██████│ 0 │██████│ /███│██\ │ \███│██/ │ . │ /███│██\ │
4708
+ │ \│/ │██████│/█████│█████\│██████│██████│/█████│█████\│ \│██████│██████│██████│█████\│██████│██████│ │██████│/█████│█████\│ \│/ │ │/█████│█████\│
4709
+ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4710
+ │ │██████│ /│██████│█████/│██████│██████│\█████│█████/│ │\█████│██████│██████│█████/│██████│██████│ │ /│██████│█████/│██████│██████│██████│\█████│█████/│
4711
+ │ . │██████│ /███│██████│██/ │██████│██████│ \███│██/ │ . │ \███│██████│██████│██/ │██████│██████│ . │ /███│██████│██/ │██████│██████│██████│ \███│██/ │
4712
+ │ │██████│/█████│██████│/ │██████│██████│ \│/ │ │ \│██████│██████│/ │██████│██████│ │/█████│██████│/ │██████│██████│██████│ \│/ │
4713
+ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4714
+ │██████│ /│██████│█████/│ /│\ │ │ │██████│██████│ │\█████│█████/│ /│\ │ │ /│██████│█████/│██████│ │ /│\ │ /│\ │
4715
+ │██████│ /███│██████│██/ │ /███│██\ │ 2 │ . │██████│██████│ 2 │ \███│██/ │ /███│██\ │ . │ /███│██████│██/ │██████│ 1 │ /███│██\ │ /███│██\ │
4716
+ │██████│/█████│██████│/ │/█████│█████\│ │ │██████│██████│ │ \│/ │/█████│█████\│ │/█████│██████│/ │██████│ │/█████│█████\│/█████│█████\│
4717
+ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4718
+ │ /│██████│█████/│ │\█████│██████│\ │ │██████│██████│ │ /│\ │\█████│█████/│██████│\█████│█████/│ │██████│ │\█████│█████/│\█████│█████/│
4719
+ │ /███│██████│██/ │ 3 │ \███│██████│██\ │ 2 │██████│██████│ 1 │ /███│██\ │ \███│██/ │██████│ \███│██/ │ . │██████│ . │ \███│██/ │ \███│██/ │
4720
+ │/█████│██████│/ │ │ \│██████│█████\│ │██████│██████│ │/█████│█████\│ \│/ │██████│ \│/ │ │██████│ │ \│/ │ \│/ │
4721
+ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4722
+ │\█████│█████/│ │██████│██████│\█████│██████│\ │██████│██████│ │\█████│██████│\ │ │ /│\ │ │ /│\ │██████│██████│ /│\ │ │
4723
+ │ \███│██/ │ . │██████│██████│ \███│██████│██\ │██████│██████│ . │ \███│██████│██\ │ . │ /███│██\ │ . │ /███│██\ │██████│██████│ /███│██\ │ 2 │
4724
+ │ \│/ │ │██████│██████│ \│██████│█████\│██████│██████│ │ \│██████│█████\│ │/█████│█████\│ │/█████│█████\│██████│██████│/█████│█████\│ │
4725
+ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4726
+ │ │ /│\ │ │ /│\ │\█████│██████│\ │ /│\ │ │\█████│██████│\ │\█████│█████/│██████│\█████│█████/│ │ /│██████│█████/│██████│
4727
+ │ 2 │ /███│██\ │ . │ /███│██\ │ \███│██████│██\ │ /███│██\ │ 3 │ \███│██████│██\ │ \███│██/ │██████│ \███│██/ │ . │ /███│██████│██/ │██████│
4728
+ │ │/█████│█████\│ │/█████│█████\│ \│██████│█████\│/█████│█████\│ │ \│██████│█████\│ \│/ │██████│ \│/ │ │/█████│██████│/ │██████│
4729
+ ├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4730
+ │██████│\█████│█████/│██████│\█████│█████/│ │\█████│█████/│\█████│█████/│██████│ │\█████│█████/│██████│██████│ │██████│██████│██████│\█████│█████/│ │██████│
4731
+ │██████│ \███│██/ │██████│ \███│██/ │ 3 │ \███│██/ │ \███│██/ │██████│ 2 │ \███│██/ │██████│██████│ 0 │██████│██████│██████│ \███│██/ │ 2 │██████│
4732
+ │██████│ \│/ │██████│ \│/ │ │ \│/ │ \│/ │██████│ │ \│/ │██████│██████│ │██████│██████│██████│ \│/ │ │██████│
4733
+ └──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┘Solutions found: 1
4734
+ status: OPTIMAL
4735
+ Time taken: 0.37 seconds
4736
+ ```
4737
+
4738
+ **Solved puzzle**
4739
+
4740
+ <img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/shakashaka_solved.png" alt="Shakashaka solved" width="500">
4741
+
4742
+ ---
4743
+
4744
+ ## Kakuro (Puzzle Type #51)
4745
+
4746
+ * [**Play online**](https://www.puzzle-kakuro.com/)
4747
+
4748
+ * [**Solver Code**][51]
4749
+
4750
+ <details>
4751
+ <summary><strong>Rules</strong></summary>
4752
+
4753
+ Kakuro is played on a rectangular grid by placing numbers in the white cells such that:
4754
+ 1. Each white cell should contain a number from 1 through 9
4755
+ 2. The clues in the black cells tells the sum of the numbers in the consecutive white cells next to that clue. (on the right or down)
4756
+ 3. The numbers in consecutive white cells must be unique.
4757
+
4758
+ </details>
4759
+
4760
+ **Unsolved puzzle**
4761
+
4762
+ <img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/kakuro_unsolved.png" alt="Kakuro unsolved" width="500">
4763
+
4764
+ Code to utilize this package and solve the puzzle:
4765
+
4766
+ ```python
4767
+ import numpy as np
4768
+ from puzzle_solver import kakuro_solver as solver
4769
+ board = np.array([
4770
+ ['#', '#', ' ', ' ', '#', ' ', ' ', '#', ' ', ' '],
4771
+ [' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ', ' '],
4772
+ [' ', ' ', ' ', '#', ' ', ' ', '#', ' ', ' ', '#'],
4773
+ ['#', '#', ' ', ' ', ' ', '#', '#', ' ', ' ', '#'],
4774
+ [' ', ' ', '#', ' ', ' ', ' ', ' ', '#', ' ', ' '],
4775
+ [' ', ' ', '#', ' ', ' ', ' ', ' ', '#', ' ', ' '],
4776
+ ['#', ' ', ' ', '#', '#', ' ', ' ', ' ', '#', '#'],
4777
+ ['#', ' ', ' ', '#', ' ', ' ', '#', ' ', ' ', ' '],
4778
+ [' ', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' '],
4779
+ [' ', ' ', '#', ' ', ' ', '#', ' ', ' ', '#', '#'],
4780
+ ])
4781
+ row_sums = [[7, 16, 12, ], [28, 23, ], [22, 16, 9, ], [18, 15, ], [12, 11, 16, ], [9, 24, 8, ], [7, 9, ], [14, 7, 20, ], [23, 30, ], [11, 3, 4, ]]
4782
+ col_sums = [[14, 12, 8, ], [15, 21, ], [29, 23, ], [8, 10, 11, ], [24, 8, ], [21, 13, ], [17, 12, 11, ], [21, 15, ], [29, 17, ], [4, 16, 15]]
4783
+ binst = solver.Board(board=board, row_sums=row_sums, col_sums=col_sums)
4784
+ solutions = binst.solve_and_print()
4785
+ ```
4786
+
4787
+ **Script Output**
4788
+
4789
+ ```python
4790
+ Solution found
4791
+ 0 0 0 0 0 0 0 0 0 0
4792
+ 0 1 2 3 4 5 6 7 8 9
4793
+ ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐
4794
+ 0│▒▒▒│▒▒▒│ 5 │ 2 │▒▒▒│ 7 │ 9 │▒▒▒│ 9 │ 3 │
4795
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4796
+ 1│ 5 │ 9 │ 8 │ 6 │▒▒▒│ 5 │ 8 │ 7 │ 2 │ 1 │
4797
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4798
+ 2│ 9 │ 6 │ 7 │▒▒▒│ 7 │ 9 │▒▒▒│ 5 │ 4 │▒▒▒│
4799
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4800
+ 3│▒▒▒│▒▒▒│ 9 │ 3 │ 6 │▒▒▒│▒▒▒│ 9 │ 6 │▒▒▒│
4801
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4802
+ 4│ 9 │ 3 │▒▒▒│ 2 │ 3 │ 1 │ 5 │▒▒▒│ 7 │ 9 │
4803
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4804
+ 5│ 3 │ 6 │▒▒▒│ 5 │ 8 │ 7 │ 4 │▒▒▒│ 1 │ 7 │
4805
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4806
+ 6│▒▒▒│ 1 │ 6 │▒▒▒│▒▒▒│ 2 │ 3 │ 4 │▒▒▒│▒▒▒│
4807
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4808
+ 7│▒▒▒│ 5 │ 9 │▒▒▒│ 4 │ 3 │▒▒▒│ 3 │ 8 │ 9 │
4809
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4810
+ 8│ 1 │ 2 │ 8 │ 9 │ 3 │▒▒▒│ 8 │ 7 │ 9 │ 6 │
4811
+ ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
4812
+ 9│ 7 │ 4 │▒▒▒│ 2 │ 1 │▒▒▒│ 3 │ 1 │▒▒▒│▒▒▒│
4813
+ └───┴───┴───┴───┴───┴───┴───┴───┴───┴───┘
4814
+ Solutions found: 1
4815
+ status: OPTIMAL
4816
+ Time taken: 0.00 seconds
4817
+ ```
4818
+
4819
+ **Solved puzzle**
4820
+
4821
+ <img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/kakuro_solved.png" alt="Kakuro solved" width="500">
4822
+
4823
+ ---
4824
+
4016
4825
  ---
4017
4826
 
4018
4827
  ## Why SAT / CP-SAT?
@@ -4109,3 +4918,9 @@ Issues and PRs welcome!
4109
4918
  [43]: https://github.com/Ar-Kareem/puzzle_solver/tree/master/src/puzzle_solver/puzzles/palisade "puzzle_solver/src/puzzle_solver/puzzles/palisade at master · Ar-Kareem/puzzle_solver · GitHub"
4110
4919
  [44]: https://github.com/Ar-Kareem/puzzle_solver/tree/master/src/puzzle_solver/puzzles/flip "puzzle_solver/src/puzzle_solver/puzzles/flip at master · Ar-Kareem/puzzle_solver · GitHub"
4111
4920
  [45]: https://github.com/Ar-Kareem/puzzle_solver/tree/master/src/puzzle_solver/puzzles/nurikabe "puzzle_solver/src/puzzle_solver/puzzles/nurikabe at master · Ar-Kareem/puzzle_solver · GitHub"
4921
+ [46]: https://github.com/Ar-Kareem/puzzle_solver/tree/master/src/puzzle_solver/puzzles/heyawake "puzzle_solver/src/puzzle_solver/puzzles/heyawake at master · Ar-Kareem/puzzle_solver · GitHub"
4922
+ [47]: https://github.com/Ar-Kareem/puzzle_solver/tree/master/src/puzzle_solver/puzzles/shingoki "puzzle_solver/src/puzzle_solver/puzzles/shingoki at master · Ar-Kareem/puzzle_solver · GitHub"
4923
+ [48]: https://github.com/Ar-Kareem/puzzle_solver/tree/master/src/puzzle_solver/puzzles/tapa "puzzle_solver/src/puzzle_solver/puzzles/tapa at master · Ar-Kareem/puzzle_solver · GitHub"
4924
+ [49]: https://github.com/Ar-Kareem/puzzle_solver/tree/master/src/puzzle_solver/puzzles/binairo_plus "puzzle_solver/src/puzzle_solver/puzzles/binairo_plus at master · Ar-Kareem/puzzle_solver · GitHub"
4925
+ [50]: https://github.com/Ar-Kareem/puzzle_solver/tree/master/src/puzzle_solver/puzzles/shakashaka "puzzle_solver/src/puzzle_solver/puzzles/shakashaka at master · Ar-Kareem/puzzle_solver · GitHub"
4926
+ [51]: https://github.com/Ar-Kareem/puzzle_solver/tree/master/src/puzzle_solver/puzzles/kakuro "puzzle_solver/src/puzzle_solver/puzzles/kakuro at master · Ar-Kareem/puzzle_solver · GitHub"