multi-puzzle-solver 1.0.7__py3-none-any.whl → 1.0.9__py3-none-any.whl

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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: multi-puzzle-solver
3
- Version: 1.0.7
3
+ Version: 1.0.9
4
4
  Summary: Efficient solvers for countless (50+) types of puzzles (like Sudoku, Minesweeper, etc.) with a simple python API.
5
5
  Author: Ar-Kareem
6
6
  Project-URL: Homepage, https://github.com/Ar-Kareem/puzzle_solver
@@ -412,6 +412,11 @@ These are all the puzzles that are implemented in this repo. <br> Click on any o
412
412
  <img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/puzzles/abc_view_solved.png" alt="ABC View" width="140">
413
413
  </a>
414
414
  </td>
415
+ <td align="center">
416
+ <a href="#mathema-grids-puzzle-type-59"><b>Mathema Grids</b><br><br>
417
+ <img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/puzzles/mathema_grids_solved.png" alt="Mathema Grids" width="140">
418
+ </a>
419
+ </td>
415
420
  </tr>
416
421
  </table>
417
422
 
@@ -485,6 +490,7 @@ These are all the puzzles that are implemented in this repo. <br> Click on any o
485
490
  - [Connect the Dots (Puzzle Type #56)](#connect-the-dots-puzzle-type-56)
486
491
  - [Nonograms Colored (Puzzle Type #57)](#nonograms-colored-puzzle-type-57)
487
492
  - [ABC View (Puzzle Type #58)](#abc-view-puzzle-type-58)
493
+ - [Mathema Grids (Puzzle Type #59)](#mathema-grids-puzzle-type-59)
488
494
  - [Why SAT / CP-SAT?](#why-sat--cp-sat)
489
495
  - [Testing](#testing)
490
496
  - [Contributing](#contributing)
@@ -604,7 +610,15 @@ Time taken: 0.04 seconds
604
610
 
605
611
  ## Sudoku (Puzzle Type #2)
606
612
 
607
- Also known as Number Place and Solo.
613
+ Also known as Number Place and Solo.
614
+
615
+ The code can:
616
+
617
+ 1. Solve arbitrarily sized valid board sizes, thus can be used to solve:
618
+ - Hex Sudoku (a 16x16 variant)
619
+ - Kidoku (a kid-friendly sudoku variant)
620
+ 2. Solve the ["Sandwich" sudoku variant](https://dkmgames.com/SandwichSudoku/) using the optional parameter `sandwich={'side': [...], 'bottom': [...]}`
621
+ 3. Solve the ["Sudoku-X" variant](https://www.sudopedia.org/wiki/Sudoku-X) using the optional parameter `unique_diagonal=True`
608
622
 
609
623
  * [**Play online**](https://www.chiark.greenend.org.uk/~sgtatham/puzzles/js/solo.html)
610
624
 
@@ -629,12 +643,6 @@ You are given some of the numbers as clues; your aim is to place the rest of the
629
643
 
630
644
  Code to utilize this package and solve the puzzle:
631
645
 
632
- Note:
633
-
634
- - The solver also supports solving the ["Sandwich" sudoku variant](https://dkmgames.com/SandwichSudoku/) through the optional parameter ``sandwich={'side': [...], 'bottom': [...] }``。
635
-
636
- - The solver also supports solving the ["Sudoku-X" variant](https://www.sudopedia.org/wiki/Sudoku-X) through the optional parameter ``unique_diagonal=True``。
637
-
638
646
  ```python
639
647
  import numpy as np
640
648
  from puzzle_solver import sudoku_solver as solver
@@ -1099,7 +1107,7 @@ Time taken: 0.15 seconds
1099
1107
 
1100
1108
  ## Keen (Puzzle Type #8)
1101
1109
 
1102
- Also known as KenKen or CalcuDoku.
1110
+ Also known as KenKen, CalcuDoku, Inkies, or Inky.
1103
1111
 
1104
1112
  * [**Play online**](https://www.chiark.greenend.org.uk/~sgtatham/puzzles/js/keen.html)
1105
1113
 
@@ -4037,6 +4045,8 @@ Applying the solution to the puzzle visually:
4037
4045
 
4038
4046
  ## Binairo (Puzzle Type #41)
4039
4047
 
4048
+ Also known as Takuzu, Binero, Tohu-Wa-Vohu (Formless and Empty), Eins und Zwei (One and Two), Binary Puzzles, Binoxxo, Binox, Zernero, Tic-Tac-Logic, and Sudoku Binary.
4049
+
4040
4050
  * [**Play online**](https://www.puzzle-binairo.com)
4041
4051
 
4042
4052
  * [**Solver Code**][41]
@@ -5862,6 +5872,80 @@ Time taken: 0.01 seconds
5862
5872
 
5863
5873
  ---
5864
5874
 
5875
+ ## Mathema Grids (Puzzle Type #59)
5876
+
5877
+ * [**Play online**](https://www.brainbashers.com/showmathemagrids.asp)
5878
+
5879
+ * [**Solver Code**][59]
5880
+
5881
+ <details>
5882
+ <summary><strong>Rules</strong></summary>
5883
+
5884
+ Complete the grid using all of the numbers from 1 to 9.
5885
+ When completed, all of the sums must be correct.
5886
+ The sums are solved strictly from left to right, and top to bottom.
5887
+ The normal order of mathematical operations is ignored.
5888
+ For example, 2 + 5 x 9 is calculated as (2 + 5) x 9 = 63.
5889
+ ÷ 1 doesn't appear in the puzzle.
5890
+ x 1 doesn't appear in the puzzle (although there might be 1 x).
5891
+ At no point will any calculation go below zero, or become fractional.
5892
+
5893
+ </details>
5894
+
5895
+ **Unsolved puzzle**
5896
+
5897
+ <img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/puzzles/mathema_grids_unsolved.png" alt="Mathema Grids unsolved" width="500">
5898
+
5899
+ Code to utilize this package and solve the puzzle:
5900
+
5901
+ ```python
5902
+ import numpy as np
5903
+ from puzzle_solver import mathema_grids_solver as solver
5904
+ board = np.array([
5905
+ [' ', '+', ' ', '-', ' ', '=', '4'],
5906
+ ['+', ' ', '+', ' ', '*', ' ', ' '],
5907
+ [' ', '*', ' ', '/', ' ', '=', '3'],
5908
+ ['*', ' ', '*', ' ', '+', ' ', ' '],
5909
+ [' ', '*', '2', '-', ' ', '=', '2'],
5910
+ ['=', ' ', '=', ' ', '=', ' ', ' '],
5911
+ ['24', ' ', '32', ' ', '30', ' ', ' '],
5912
+ ])
5913
+ binst = solver.Board(board=board, digits=[1, 2, 3, 4, 5, 6, 7, 8, 9])
5914
+ solutions = binst.solve_and_print()
5915
+ ```
5916
+
5917
+ **Script Output**
5918
+
5919
+ ```python
5920
+ Solution found
5921
+
5922
+ 0 1 2 3 4 5 6
5923
+ ┌───┬───┬───┬───┬───┬───┬───┐
5924
+ 0│ 5 │ + │ 7 │ - │ 8 │ = │ 4 │
5925
+ ├───┼───┼───┼───┼───┼───┼───┤
5926
+ 1│ + │ │ + │ │ * │ │ │
5927
+ ├───┼───┼───┼───┼───┼───┼───┤
5928
+ 2│ 1 │ * │ 9 │ / │ 3 │ = │ 3 │
5929
+ ├───┼───┼───┼───┼───┼───┼───┤
5930
+ 3│ * │ │ * │ │ + │ │ │
5931
+ ├───┼───┼───┼───┼───┼───┼───┤
5932
+ 4│ 4 │ * │ 2 │ - │ 6 │ = │ 2 │
5933
+ ├───┼───┼───┼───┼───┼───┼───┤
5934
+ 5│ = │ │ = │ │ = │ │ │
5935
+ ├───┼───┼───┼───┼───┼───┼───┤
5936
+ 6│24 │ │32 │ │30 │ │ │
5937
+ └───┴───┴───┴───┴───┴───┴───┘
5938
+ Solutions found: 1
5939
+ status: OPTIMAL
5940
+ Time taken: 0.00 seconds
5941
+ ```
5942
+
5943
+ **Solved puzzle**
5944
+
5945
+ <img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/puzzles/mathema_grids_solved.png" alt="Mathema Grids solved" width="500">
5946
+
5947
+ ---
5948
+
5865
5949
  ---
5866
5950
 
5867
5951
  ## Why SAT / CP-SAT?
@@ -5971,3 +6055,4 @@ Issues and PRs welcome!
5971
6055
  [56]: https://github.com/Ar-Kareem/puzzle_solver/tree/master/src/puzzle_solver/puzzles/connect_the_dots "puzzle_solver/src/puzzle_solver/puzzles/connect_the_dots at master · Ar-Kareem/puzzle_solver · GitHub"
5972
6056
  [57]: https://github.com/Ar-Kareem/puzzle_solver/tree/master/src/puzzle_solver/puzzles/nonograms "puzzle_solver/src/puzzle_solver/puzzles/nonograms at master · Ar-Kareem/puzzle_solver · GitHub"
5973
6057
  [58]: https://github.com/Ar-Kareem/puzzle_solver/tree/master/src/puzzle_solver/puzzles/abc_view "puzzle_solver/src/puzzle_solver/puzzles/abc_view at master · Ar-Kareem/puzzle_solver · GitHub"
6058
+ [59]: https://github.com/Ar-Kareem/puzzle_solver/tree/master/src/puzzle_solver/puzzles/mathema_grids "puzzle_solver/src/puzzle_solver/puzzles/mathema_grids at master · Ar-Kareem/puzzle_solver · GitHub"
@@ -1,11 +1,11 @@
1
- puzzle_solver/__init__.py,sha256=CiplXqjf9w0kuDmtvive0gM8hkZEIRQNgaK1A_X_ZwE,5390
1
+ puzzle_solver/__init__.py,sha256=mCXXxGttWhDOTXSDFI2CrplOLmSFVF9r_XygisFqiAY,5502
2
2
  puzzle_solver/core/utils.py,sha256=FE0106dfQRsgCn2FRBvRq5zILLK7-Z3cPHkAlBWUX0w,8785
3
3
  puzzle_solver/core/utils_ortools.py,sha256=ACV3HgKWpEUTt1lpqsPryK1DeZpu7kdWQKEWTLJ2tfs,10384
4
- puzzle_solver/core/utils_visualizer.py,sha256=AmVeBuEMaJzVY2zBbRoONlC9x3AGLKcdaNn8mD-nrLs,23347
4
+ puzzle_solver/core/utils_visualizer.py,sha256=3EJ7V8rHyasj1peAzplDJfKkPy6Yj9j7BXqMBWQ3eNg,22834
5
5
  puzzle_solver/puzzles/abc_view/abc_view.py,sha256=Qr0rZKmKQ2teStHjQ5VPQ4k-XptsjJAlZ1WXWk5Aax4,4570
6
6
  puzzle_solver/puzzles/aquarium/aquarium.py,sha256=dGqYEWMoh4di5DN4sd-GtYb6QeTpVYFQJHBkrrmrudQ,5649
7
7
  puzzle_solver/puzzles/battleships/battleships.py,sha256=U4xJ_NJC2baHvfaAfJ01YEBjixq9gD0h8GP9L1V-_oM,7223
8
- puzzle_solver/puzzles/binairo/binairo.py,sha256=qKvpixLIBUcugAyJgpBGHV-9q_4nzA1ZOxeDFnltsXA,6843
8
+ puzzle_solver/puzzles/binairo/binairo.py,sha256=EBpXYD9Mxuig4uJl3xkcQ6_tbnoG13mVV7RZpQEXm38,5790
9
9
  puzzle_solver/puzzles/binairo/binairo_plus.py,sha256=TvLG3olwANtft3LuCF-y4OofpU9PNa4IXDqgZqsD-g0,267
10
10
  puzzle_solver/puzzles/black_box/black_box.py,sha256=RXTXQhMAb_Oce9Mk1XpouniYIyy9k3kYGdey-SEeRMU,12559
11
11
  puzzle_solver/puzzles/bridges/bridges.py,sha256=QwOhZyO5urbatkNyPmQxZ_lGM01ZejndMr_eoiBkr7g,5394
@@ -33,13 +33,14 @@ puzzle_solver/puzzles/light_up/light_up.py,sha256=iSA1rjZMFsnI0V0Nxivxox4qZkB7Pv
33
33
  puzzle_solver/puzzles/lits/lits.py,sha256=QeXFiCnWNI9jzUj3QLgU20mXxE2DD9o4BJsUb0TswKk,7231
34
34
  puzzle_solver/puzzles/magnets/magnets.py,sha256=-Wl49JD_PKeq735zQVMQ3XSQX6gdHiY-7PKw-Sh16jw,6474
35
35
  puzzle_solver/puzzles/map/map.py,sha256=sxc57tapB8Tsgam-yoDitln1o-EB_SbIYvO6WEYy3us,2582
36
+ puzzle_solver/puzzles/mathema_grids/mathema_grids.py,sha256=wXj3pfXUMh3deFA6XXndZXod6ZNyCVt9vX1akt9zz20,6380
36
37
  puzzle_solver/puzzles/minesweeper/minesweeper.py,sha256=gSdFsuZ-KrwVxgI1HF2q_pYleZ6vBm9jjRTFlboVnLY,5871
37
38
  puzzle_solver/puzzles/mosaic/mosaic.py,sha256=T89tkyTbob3LT20vwY3hkkEtNi8bxp2_CLaVi1gzhBc,1974
38
39
  puzzle_solver/puzzles/nonograms/nonograms.py,sha256=Q-VHI0IPR2igccnE617HPThj5tnBgt27MiLWIZPtYcI,5587
39
- puzzle_solver/puzzles/nonograms/nonograms_colored.py,sha256=Qy3CGNNs0MoZQv-qHyMMP8-fK7s7f_utK-Rc1hQaX_A,10750
40
+ puzzle_solver/puzzles/nonograms/nonograms_colored.py,sha256=XpxzpJw0GA-tE7PiltlA-dfypaTvqNIDLnKl1LxIjD4,10500
40
41
  puzzle_solver/puzzles/norinori/norinori.py,sha256=ZEDWrD7zvEuqXOdXGOrELh1n_mWzhzZa3chs6Zqd3Pc,4570
41
42
  puzzle_solver/puzzles/nurikabe/nurikabe.py,sha256=hX0VcjPwO8PfY2kiIpQV45FWIvKRosFebk588tp5wzk,6603
42
- puzzle_solver/puzzles/palisade/palisade.py,sha256=Stvgw0k_sml9Dj5RMRVf0EmU5a_eGf1fn65IXelR6Wk,4802
43
+ puzzle_solver/puzzles/palisade/palisade.py,sha256=rUYI39DOxKu_XSJ-Y_mdQGpGM-YLgKw_kjDWes97ncQ,4701
43
44
  puzzle_solver/puzzles/pearl/pearl.py,sha256=slPVCzPObQLNk4EYqe55YR4JeRCUs07Mjdks1fWKZSY,6696
44
45
  puzzle_solver/puzzles/pipes/pipes.py,sha256=2HDHCWhD-fLYTRoJsx15gOrsgt_SbjlGF2QDS5UX6m8,4680
45
46
  puzzle_solver/puzzles/range/range.py,sha256=sJVMKzoT5unihMKurriAUTGLY0f7OQXSZfSHWezPPkw,3387
@@ -60,7 +61,7 @@ puzzle_solver/puzzles/tapa/tapa.py,sha256=554Xun39M3oJ5kOUwrhLUtbUXbsAYj4DH-GBht
60
61
  puzzle_solver/puzzles/tents/tents.py,sha256=81hAtmNNYIgzh0tEa0BuExmdzQfGVrlwjn_Dw8hEp3c,4943
61
62
  puzzle_solver/puzzles/thermometers/thermometers.py,sha256=bGcVmpPeqL5AJtj8jkK8gYThzv9aGCd_QrWEiYBCA2s,4011
62
63
  puzzle_solver/puzzles/towers/towers.py,sha256=OLyTf9nTFR5L32-S_fhVyBmpz4i5YUNJotwOwbw_Fjg,6500
63
- puzzle_solver/puzzles/tracks/tracks.py,sha256=u34nOCvLHQrQFdInGpM3Y1dX_A30SNh4o6W4l7BSPmE,5516
64
+ puzzle_solver/puzzles/tracks/tracks.py,sha256=MnwbjGeWdmk2iw0Tc3YPjz-fE_uHWEoKNKbuCwsRuCo,5505
64
65
  puzzle_solver/puzzles/twiddle/twiddle.py,sha256=3gPoeD0DoiiZbIhtptdXFldO_t1QShL6IxkDqJMzjkk,5446
65
66
  puzzle_solver/puzzles/undead/undead.py,sha256=IGFQysgoaKZH8rKjqlrkoHsH28ve4_hKor2f0QOsWY0,6596
66
67
  puzzle_solver/puzzles/unequal/unequal.py,sha256=ExY2XDCrqROCDpRLfHo8uVr1zuli1QvbCdNCiDhlCac,6978
@@ -68,7 +69,7 @@ puzzle_solver/puzzles/unruly/unruly.py,sha256=_C6FhYm9rqwhlQa6TMTxYr3rWcP_QS-E93
68
69
  puzzle_solver/puzzles/yin_yang/yin_yang.py,sha256=D0JacUdK5yPrfScmGqX-p8144VbwxfDgIaqF8hwLXlM,5039
69
70
  puzzle_solver/puzzles/yin_yang/parse_map/parse_map.py,sha256=drjfoHqmFf6U-ZQUwrBbfGINRxDQpgbvy4U3D9QyMhM,6617
70
71
  puzzle_solver/utils/visualizer.py,sha256=T2g5We9J3tkhyXWoN2OrIDIJDjt6w5sDd2ksOub0ZI8,6819
71
- multi_puzzle_solver-1.0.7.dist-info/METADATA,sha256=WfWXNWvZZPMkq8SmkWShIMpG6S4dDZcvayWDFIyM9-A,452620
72
- multi_puzzle_solver-1.0.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
73
- multi_puzzle_solver-1.0.7.dist-info/top_level.txt,sha256=exwVUQa-anK9vYrpKzBPvH8bX43iElWI4VeNiAyBGJY,14
74
- multi_puzzle_solver-1.0.7.dist-info/RECORD,,
72
+ multi_puzzle_solver-1.0.9.dist-info/METADATA,sha256=DsMyTWC0gI51MbgX6UecmA6jdP_pbGE-RLrHCK9Cyhk,456299
73
+ multi_puzzle_solver-1.0.9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
74
+ multi_puzzle_solver-1.0.9.dist-info/top_level.txt,sha256=exwVUQa-anK9vYrpKzBPvH8bX43iElWI4VeNiAyBGJY,14
75
+ multi_puzzle_solver-1.0.9.dist-info/RECORD,,
puzzle_solver/__init__.py CHANGED
@@ -23,6 +23,7 @@ from puzzle_solver.puzzles.keen import keen as keen_solver
23
23
  from puzzle_solver.puzzles.light_up import light_up as light_up_solver
24
24
  from puzzle_solver.puzzles.magnets import magnets as magnets_solver
25
25
  from puzzle_solver.puzzles.map import map as map_solver
26
+ from puzzle_solver.puzzles.mathema_grids import mathema_grids as mathema_grids_solver
26
27
  from puzzle_solver.puzzles.minesweeper import minesweeper as minesweeper_solver
27
28
  from puzzle_solver.puzzles.mosaic import mosaic as mosaic_solver
28
29
  from puzzle_solver.puzzles.nonograms import nonograms as nonograms_solver
@@ -84,6 +85,7 @@ __all__ = [
84
85
  light_up_solver,
85
86
  magnets_solver,
86
87
  map_solver,
88
+ mathema_grids_solver,
87
89
  minesweeper_solver,
88
90
  mosaic_solver,
89
91
  nonograms_solver,
@@ -119,4 +121,4 @@ __all__ = [
119
121
  inertia_image_parser,
120
122
  ]
121
123
 
122
- __version__ = '1.0.7'
124
+ __version__ = '1.0.9'