multi-puzzle-solver 0.9.2__tar.gz → 0.9.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/PKG-INFO +111 -28
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/README.md +110 -27
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/src/multi_puzzle_solver.egg-info/PKG-INFO +111 -28
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/src/multi_puzzle_solver.egg-info/SOURCES.txt +3 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/src/puzzle_solver/__init__.py +2 -1
- multi_puzzle_solver-0.9.3/src/puzzle_solver/puzzles/aquarium/aquarium.py +112 -0
- multi_puzzle_solver-0.9.3/src/puzzle_solver/utils/visualizer.py +108 -0
- multi_puzzle_solver-0.9.3/tests/test_aquarium.py +87 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/pyproject.toml +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/setup.cfg +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/src/multi_puzzle_solver.egg-info/dependency_links.txt +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/src/multi_puzzle_solver.egg-info/requires.txt +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/src/multi_puzzle_solver.egg-info/top_level.txt +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/src/puzzle_solver/core/utils.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/src/puzzle_solver/core/utils_ortools.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/src/puzzle_solver/puzzles/bridges/bridges.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/src/puzzle_solver/puzzles/chess_range/chess_melee.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/src/puzzle_solver/puzzles/chess_range/chess_range.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/src/puzzle_solver/puzzles/chess_range/chess_solo.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/src/puzzle_solver/puzzles/dominosa/dominosa.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/src/puzzle_solver/puzzles/filling/filling.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/src/puzzle_solver/puzzles/guess/guess.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/src/puzzle_solver/puzzles/inertia/inertia.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/src/puzzle_solver/puzzles/inertia/parse_map/parse_map.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/src/puzzle_solver/puzzles/inertia/tsp.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/src/puzzle_solver/puzzles/keen/keen.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/src/puzzle_solver/puzzles/light_up/light_up.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/src/puzzle_solver/puzzles/magnets/magnets.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/src/puzzle_solver/puzzles/map/map.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/src/puzzle_solver/puzzles/minesweeper/minesweeper.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/src/puzzle_solver/puzzles/mosaic/mosaic.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/src/puzzle_solver/puzzles/nonograms/nonograms.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/src/puzzle_solver/puzzles/pearl/pearl.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/src/puzzle_solver/puzzles/range/range.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/src/puzzle_solver/puzzles/signpost/signpost.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/src/puzzle_solver/puzzles/singles/singles.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/src/puzzle_solver/puzzles/sudoku/sudoku.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/src/puzzle_solver/puzzles/tents/tents.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/src/puzzle_solver/puzzles/thermometers/thermometers.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/src/puzzle_solver/puzzles/towers/towers.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/src/puzzle_solver/puzzles/tracks/tracks.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/src/puzzle_solver/puzzles/undead/undead.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/src/puzzle_solver/puzzles/unruly/unruly.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/tests/test_bridges.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/tests/test_chess_melee.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/tests/test_chess_range.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/tests/test_chess_solo.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/tests/test_dominosa.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/tests/test_filling.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/tests/test_guess.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/tests/test_inertia.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/tests/test_keen.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/tests/test_light_up.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/tests/test_magnets.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/tests/test_map.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/tests/test_minesweeper.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/tests/test_mosaic.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/tests/test_nonograms.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/tests/test_pearl.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/tests/test_range.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/tests/test_signpost.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/tests/test_singles.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/tests/test_sudoku.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/tests/test_tents.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/tests/test_thermometers.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/tests/test_towers.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/tests/test_tracks.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/tests/test_undead.py +0 -0
- {multi_puzzle_solver-0.9.2 → multi_puzzle_solver-0.9.3}/tests/test_unruly.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: multi-puzzle-solver
|
3
|
-
Version: 0.9.
|
3
|
+
Version: 0.9.3
|
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
|
@@ -89,142 +89,147 @@ These are all the puzzles that are implemented in this repo. <br> Click on any o
|
|
89
89
|
<tr>
|
90
90
|
<td align="center">
|
91
91
|
<a href="#nonograms-puzzle-type-1"><b>Nonograms</b><br><br>
|
92
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/nonogram_solved.png" alt="Nonograms" width="
|
92
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/nonogram_solved.png" alt="Nonograms" width="140">
|
93
93
|
</a>
|
94
94
|
</td>
|
95
95
|
<td align="center">
|
96
96
|
<a href="#sudoku-puzzle-type-2"><b>Sudoku</b><br><br>
|
97
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/sudoku_solved.png" alt="Sudoku" width="
|
97
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/sudoku_solved.png" alt="Sudoku" width="140">
|
98
98
|
</a>
|
99
99
|
</td>
|
100
100
|
<td align="center">
|
101
101
|
<a href="#minesweeper-puzzle-type-3"><b>Minesweeper</b><br><br>
|
102
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/minesweeper_pre.png" alt="Minesweeper" width="
|
102
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/minesweeper_pre.png" alt="Minesweeper" width="140">
|
103
103
|
</a>
|
104
104
|
</td>
|
105
105
|
<td align="center">
|
106
106
|
<a href="#dominosa-puzzle-type-4"><b>Dominosa</b><br><br>
|
107
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/dominosa_solved.png" alt="Dominosa" width="
|
107
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/dominosa_solved.png" alt="Dominosa" width="140">
|
108
108
|
</a>
|
109
109
|
</td>
|
110
110
|
<td align="center">
|
111
111
|
<a href="#light-up-puzzle-type-5"><b>Light Up</b><br><br>
|
112
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/lightup_solved.png" alt="Light Up" width="
|
112
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/lightup_solved.png" alt="Light Up" width="140">
|
113
113
|
</a>
|
114
114
|
</td>
|
115
115
|
</tr>
|
116
116
|
<tr>
|
117
117
|
<td align="center">
|
118
118
|
<a href="#tents-puzzle-type-6"><b>Tents</b><br><br>
|
119
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/tents_solved.png" alt="Tents" width="
|
119
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/tents_solved.png" alt="Tents" width="140">
|
120
120
|
</a>
|
121
121
|
</td>
|
122
122
|
<td align="center">
|
123
123
|
<a href="#filling-puzzle-type-7"><b>Filling</b><br><br>
|
124
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/filling_solved.png" alt="Filling" width="
|
124
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/filling_solved.png" alt="Filling" width="140">
|
125
125
|
</a>
|
126
126
|
</td>
|
127
127
|
<td align="center">
|
128
128
|
<a href="#keen-puzzle-type-8"><b>Keen</b><br><br>
|
129
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/keen_solved.png" alt="Keen" width="
|
129
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/keen_solved.png" alt="Keen" width="140">
|
130
130
|
</a>
|
131
131
|
</td>
|
132
132
|
<td align="center">
|
133
133
|
<a href="#towers-puzzle-type-9"><b>Towers</b><br><br>
|
134
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/towers_solved.png" alt="Towers" width="
|
134
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/towers_solved.png" alt="Towers" width="140">
|
135
135
|
</a>
|
136
136
|
</td>
|
137
137
|
<td align="center">
|
138
138
|
<a href="#singles-puzzle-type-10"><b>Singles</b><br><br>
|
139
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/singles_solved.png" alt="Singles" width="
|
139
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/singles_solved.png" alt="Singles" width="140">
|
140
140
|
</a>
|
141
141
|
</td>
|
142
142
|
</tr>
|
143
143
|
<tr>
|
144
144
|
<td align="center">
|
145
145
|
<a href="#magnets-puzzle-type-11"><b>Magnets</b><br><br>
|
146
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/magnets_solved.png" alt="Magnets" width="
|
146
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/magnets_solved.png" alt="Magnets" width="140">
|
147
147
|
</a>
|
148
148
|
</td>
|
149
149
|
<td align="center">
|
150
150
|
<a href="#signpost-puzzle-type-12"><b>Signpost</b><br><br>
|
151
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/signpost_solved.png" alt="Signpost" width="
|
151
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/signpost_solved.png" alt="Signpost" width="140">
|
152
152
|
</a>
|
153
153
|
</td>
|
154
154
|
<td align="center">
|
155
155
|
<a href="#range-puzzle-type-13"><b>Range</b><br><br>
|
156
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/range_solved.png" alt="Range" width="
|
156
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/range_solved.png" alt="Range" width="140">
|
157
157
|
</a>
|
158
158
|
</td>
|
159
159
|
<td align="center">
|
160
160
|
<a href="#undead-puzzle-type-14"><b>Undead</b><br><br>
|
161
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/undead_solved.png" alt="Undead" width="
|
161
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/undead_solved.png" alt="Undead" width="140">
|
162
162
|
</a>
|
163
163
|
</td>
|
164
164
|
<td align="center">
|
165
165
|
<a href="#unruly-puzzle-type-15"><b>Unruly</b><br><br>
|
166
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/unruly_solved.png" alt="Unruly" width="
|
166
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/unruly_solved.png" alt="Unruly" width="140">
|
167
167
|
</a>
|
168
168
|
</td>
|
169
169
|
</tr>
|
170
170
|
<tr>
|
171
171
|
<td align="center">
|
172
172
|
<a href="#tracks-puzzle-type-16"><b>Tracks</b><br><br>
|
173
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/tracks_solved.png" alt="Tracks" width="
|
173
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/tracks_solved.png" alt="Tracks" width="140">
|
174
174
|
</a>
|
175
175
|
</td>
|
176
176
|
<td align="center">
|
177
177
|
<a href="#mosaic-puzzle-type-17"><b>Mosaic</b><br><br>
|
178
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/mosaic_solved.png" alt="Mosaic" width="
|
178
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/mosaic_solved.png" alt="Mosaic" width="140">
|
179
179
|
</a>
|
180
180
|
</td>
|
181
181
|
<td align="center">
|
182
182
|
<a href="#map-puzzle-type-18"><b>Map</b><br><br>
|
183
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/map_solved.png" alt="Map" width="
|
183
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/map_solved.png" alt="Map" width="140">
|
184
184
|
</a>
|
185
185
|
</td>
|
186
186
|
<td align="center">
|
187
187
|
<a href="#pearl-puzzle-type-19"><b>Pearl</b><br><br>
|
188
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/pearl_solved.png" alt="Pearl" width="
|
188
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/pearl_solved.png" alt="Pearl" width="140">
|
189
189
|
</a>
|
190
190
|
</td>
|
191
191
|
<td align="center">
|
192
192
|
<a href="#bridges-puzzle-type-20"><b>Bridges</b><br><br>
|
193
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/bridges_solved.png" alt="Bridges" width="
|
193
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/bridges_solved.png" alt="Bridges" width="140">
|
194
194
|
</a>
|
195
195
|
</td>
|
196
196
|
</tr>
|
197
197
|
<tr>
|
198
198
|
<td align="center">
|
199
199
|
<a href="#inertia-puzzle-type-21"><b>Inertia</b><br><br>
|
200
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/inertia_unsolved.png" alt="Inertia" width="
|
200
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/inertia_unsolved.png" alt="Inertia" width="140">
|
201
201
|
</a>
|
202
202
|
</td>
|
203
203
|
<td align="center">
|
204
204
|
<a href="#guess-puzzle-type-22"><b>Guess</b><br><br>
|
205
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/guess_3.png" alt="Guess" width="
|
205
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/guess_3.png" alt="Guess" width="140">
|
206
206
|
</a>
|
207
207
|
</td>
|
208
208
|
<td align="center">
|
209
209
|
<a href="#chess-range-puzzle-type-23"><b>Chess Range</b><br><br>
|
210
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/chess_range_unsolved.png" alt="Chess range" width="
|
210
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/chess_range_unsolved.png" alt="Chess range" width="140">
|
211
211
|
</a>
|
212
212
|
</td>
|
213
213
|
<td align="center">
|
214
214
|
<a href="#chess-solo-puzzle-type-24"><b>Chess Solo</b><br><br>
|
215
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/chess_solo_unsolved.png" alt="Chess solo" width="
|
215
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/chess_solo_unsolved.png" alt="Chess solo" width="140">
|
216
216
|
</a>
|
217
217
|
</td>
|
218
218
|
<td align="center">
|
219
219
|
<a href="#chess-melee-puzzle-type-25"><b>Chess Melee</b><br><br>
|
220
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/chess_melee_unsolved.png" alt="Chess melee" width="
|
220
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/chess_melee_unsolved.png" alt="Chess melee" width="140">
|
221
221
|
</a>
|
222
222
|
</td>
|
223
223
|
</tr>
|
224
224
|
<tr>
|
225
225
|
<td align="center">
|
226
226
|
<a href="#thermometers-puzzle-type-26"><b>Thermometers</b><br><br>
|
227
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/
|
227
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/thermometers_solved.png" alt="Thermometers" width="140">
|
228
|
+
</a>
|
229
|
+
</td>
|
230
|
+
<td align="center">
|
231
|
+
<a href="#aquarium-puzzle-type-27"><b>Aquarium</b><br><br>
|
232
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/aquarium_solved.png" alt="Aquarium" width="140">
|
228
233
|
</a>
|
229
234
|
</td>
|
230
235
|
</tr>
|
@@ -268,6 +273,7 @@ These are all the puzzles that are implemented in this repo. <br> Click on any o
|
|
268
273
|
- [Chess Solo (Puzzle Type #24)](#chess-solo-puzzle-type-24)
|
269
274
|
- [Chess Melee (Puzzle Type #25)](#chess-melee-puzzle-type-25)
|
270
275
|
- [Thermometers (Puzzle Type #26)](#thermometers-puzzle-type-26)
|
276
|
+
- [Aquarium (Puzzle Type #27)](#aquarium-puzzle-type-27)
|
271
277
|
- [Why SAT / CP-SAT?](#why-sat--cp-sat)
|
272
278
|
- [Testing](#testing)
|
273
279
|
- [Contributing](#contributing)
|
@@ -2117,6 +2123,7 @@ Time taken: 6.24 seconds
|
|
2117
2123
|
<summary><strong>Rules</strong></summary>
|
2118
2124
|
|
2119
2125
|
You have to fill some thermometers with mercury starting from the bulb and going toward the end without gaps.
|
2126
|
+
|
2120
2127
|
The numbers outside the grid show the number of filled cells horizontally and vertically.
|
2121
2128
|
|
2122
2129
|
</details>
|
@@ -2177,9 +2184,84 @@ status: OPTIMAL
|
|
2177
2184
|
Time taken: 0.01 seconds
|
2178
2185
|
```
|
2179
2186
|
|
2187
|
+
## Aquarium (Puzzle Type #27)
|
2188
|
+
|
2189
|
+
* [**Play online**](https://www.puzzle-aquarium.com/)
|
2190
|
+
|
2191
|
+
* [**Solver Code**][27]
|
2192
|
+
|
2193
|
+
<details>
|
2194
|
+
<summary><strong>Rules</strong></summary>
|
2195
|
+
|
2196
|
+
The puzzle is played on a rectangular grid divided into blocks called "aquariums"
|
2197
|
+
|
2198
|
+
You have to "fill" the aquariums with water up to a certain level or leave it empty.
|
2199
|
+
|
2200
|
+
The water level in each aquarium is one and the same across its full width
|
2201
|
+
|
2202
|
+
The numbers outside the grid show the number of filled cells horizontally and vertically.
|
2203
|
+
|
2204
|
+
</details>
|
2205
|
+
|
2206
|
+
**Unsolved puzzle**
|
2207
|
+
|
2208
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/aquarium_unsolved.png" alt="Aquarium unsolved" width="500">
|
2209
|
+
|
2210
|
+
Code to utilize this package and solve the puzzle:
|
2211
|
+
|
2212
|
+
(Note that this puzzle does not typically have a unique solution. Thus, we specify here that we only want the first valid solution that the solver finds.)
|
2213
|
+
|
2214
|
+
```python
|
2215
|
+
from puzzle_solver import aquarium_solver as solver
|
2216
|
+
board = np.array([
|
2217
|
+
['01', '01', '01', '01', '02', '02', '02', '03', '03', '03', '03', '04', '05', '05', '05'],
|
2218
|
+
['01', '02', '02', '02', '02', '06', '07', '07', '03', '08', '03', '04', '04', '05', '09'],
|
2219
|
+
['01', '01', '02', '11', '06', '06', '06', '12', '12', '08', '13', '13', '13', '09', '09'],
|
2220
|
+
['01', '11', '11', '11', '14', '06', '06', '12', '12', '15', '15', '13', '09', '09', '09'],
|
2221
|
+
['01', '01', '11', '11', '14', '12', '12', '12', '16', '16', '15', '13', '13', '17', '09'],
|
2222
|
+
['45', '11', '11', '14', '14', '12', '42', '42', '42', '15', '15', '13', '13', '17', '18'],
|
2223
|
+
['45', '11', '11', '14', '14', '12', '12', '43', '15', '15', '20', '13', '13', '17', '18'],
|
2224
|
+
['46', '46', '11', '19', '19', '19', '43', '43', '44', '20', '20', '20', '13', '17', '18'],
|
2225
|
+
['46', '22', '23', '23', '23', '19', '43', '21', '21', '24', '24', '24', '25', '17', '17'],
|
2226
|
+
['22', '22', '22', '23', '19', '19', '26', '24', '24', '24', '28', '28', '25', '17', '33'],
|
2227
|
+
['22', '22', '23', '23', '27', '27', '26', '26', '24', '24', '29', '29', '25', '25', '33'],
|
2228
|
+
['22', '22', '35', '27', '27', '26', '26', '26', '26', '30', '30', '30', '25', '34', '34'],
|
2229
|
+
['37', '22', '35', '35', '35', '35', '35', '26', '26', '30', '31', '31', '32', '32', '40'],
|
2230
|
+
['37', '37', '37', '36', '36', '35', '26', '26', '26', '40', '40', '40', '40', '40', '40'],
|
2231
|
+
['37', '37', '37', '37', '35', '35', '38', '38', '39', '39', '40', '40', '40', '41', '41'],
|
2232
|
+
])
|
2233
|
+
top = np.array([6, 6, 5, 3, 3, 4, 7, 6, 9, 6, 3, 4, 9, 6, 7])
|
2234
|
+
side = np.array([3, 5, 1, 2, 5, 3, 10, 10, 5, 3, 7, 3, 7, 8, 12])
|
2235
|
+
binst = solver.Board(board=board, top=top, side=side)
|
2236
|
+
solutions = binst.solve_and_print()
|
2237
|
+
```
|
2238
|
+
**Script Output**
|
2239
|
+
|
2240
|
+
```python
|
2241
|
+
Solution found
|
2242
|
+
[['0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '1' '1' '1']
|
2243
|
+
['0' '0' '0' '0' '0' '0' '0' '0' '1' '0' '1' '1' '1' '1' '0']
|
2244
|
+
['0' '0' '0' '0' '0' '0' '0' '0' '0' '1' '0' '0' '0' '0' '0']
|
2245
|
+
['0' '0' '0' '0' '0' '1' '1' '0' '0' '0' '0' '0' '0' '0' '0']
|
2246
|
+
['1' '1' '0' '0' '0' '0' '0' '0' '1' '1' '0' '0' '0' '0' '1']
|
2247
|
+
['0' '0' '0' '0' '0' '0' '1' '1' '1' '0' '0' '0' '0' '0' '0']
|
2248
|
+
['1' '1' '1' '0' '0' '1' '1' '0' '1' '1' '0' '1' '1' '0' '1']
|
2249
|
+
['1' '1' '1' '0' '0' '0' '1' '1' '0' '1' '1' '1' '1' '0' '1']
|
2250
|
+
['1' '0' '0' '0' '0' '0' '1' '1' '1' '0' '0' '0' '1' '0' '0']
|
2251
|
+
['0' '0' '0' '0' '1' '1' '0' '0' '0' '0' '0' '0' '1' '0' '0']
|
2252
|
+
['0' '0' '1' '1' '0' '0' '0' '0' '1' '1' '0' '0' '1' '1' '1']
|
2253
|
+
['0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '1' '1' '1']
|
2254
|
+
['0' '1' '0' '0' '0' '0' '0' '1' '1' '0' '1' '1' '1' '1' '0']
|
2255
|
+
['1' '1' '1' '1' '1' '0' '1' '1' '1' '0' '0' '0' '0' '0' '0']
|
2256
|
+
['1' '1' '1' '1' '1' '1' '1' '1' '1' '1' '0' '0' '0' '1' '1']]
|
2257
|
+
Solutions found: 1
|
2258
|
+
status: OPTIMAL
|
2259
|
+
Time taken: 0.02 seconds
|
2260
|
+
```
|
2261
|
+
|
2180
2262
|
**Solved puzzle**
|
2181
2263
|
|
2182
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/
|
2264
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/aquarium_solved.png" alt="Aquarium solved" width="500">
|
2183
2265
|
|
2184
2266
|
---
|
2185
2267
|
|
@@ -2260,3 +2342,4 @@ Issues and PRs welcome!
|
|
2260
2342
|
[24]: https://github.com/Ar-Kareem/puzzle_solver/tree/master/src/puzzle_solver/puzzles/chess_range#chess-solo-puzzle-type-24 "puzzle_solver/src/puzzle_solver/puzzles/chess_range at master · Ar-Kareem/puzzle_solver · GitHub"
|
2261
2343
|
[25]: https://github.com/Ar-Kareem/puzzle_solver/tree/master/src/puzzle_solver/puzzles/chess_range#chess-melee-puzzle-type-25 "puzzle_solver/src/puzzle_solver/puzzles/chess_range at master · Ar-Kareem/puzzle_solver · GitHub"
|
2262
2344
|
[26]: https://github.com/Ar-Kareem/puzzle_solver/tree/master/src/puzzle_solver/puzzles/thermometers "puzzle_solver/src/puzzle_solver/puzzles/thermometers at master · Ar-Kareem/puzzle_solver · GitHub"
|
2345
|
+
[27]: https://github.com/Ar-Kareem/puzzle_solver/tree/master/src/puzzle_solver/puzzles/aquarium "puzzle_solver/src/puzzle_solver/puzzles/aquarium at master · Ar-Kareem/puzzle_solver · GitHub"
|
@@ -63,142 +63,147 @@ These are all the puzzles that are implemented in this repo. <br> Click on any o
|
|
63
63
|
<tr>
|
64
64
|
<td align="center">
|
65
65
|
<a href="#nonograms-puzzle-type-1"><b>Nonograms</b><br><br>
|
66
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/nonogram_solved.png" alt="Nonograms" width="
|
66
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/nonogram_solved.png" alt="Nonograms" width="140">
|
67
67
|
</a>
|
68
68
|
</td>
|
69
69
|
<td align="center">
|
70
70
|
<a href="#sudoku-puzzle-type-2"><b>Sudoku</b><br><br>
|
71
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/sudoku_solved.png" alt="Sudoku" width="
|
71
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/sudoku_solved.png" alt="Sudoku" width="140">
|
72
72
|
</a>
|
73
73
|
</td>
|
74
74
|
<td align="center">
|
75
75
|
<a href="#minesweeper-puzzle-type-3"><b>Minesweeper</b><br><br>
|
76
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/minesweeper_pre.png" alt="Minesweeper" width="
|
76
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/minesweeper_pre.png" alt="Minesweeper" width="140">
|
77
77
|
</a>
|
78
78
|
</td>
|
79
79
|
<td align="center">
|
80
80
|
<a href="#dominosa-puzzle-type-4"><b>Dominosa</b><br><br>
|
81
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/dominosa_solved.png" alt="Dominosa" width="
|
81
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/dominosa_solved.png" alt="Dominosa" width="140">
|
82
82
|
</a>
|
83
83
|
</td>
|
84
84
|
<td align="center">
|
85
85
|
<a href="#light-up-puzzle-type-5"><b>Light Up</b><br><br>
|
86
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/lightup_solved.png" alt="Light Up" width="
|
86
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/lightup_solved.png" alt="Light Up" width="140">
|
87
87
|
</a>
|
88
88
|
</td>
|
89
89
|
</tr>
|
90
90
|
<tr>
|
91
91
|
<td align="center">
|
92
92
|
<a href="#tents-puzzle-type-6"><b>Tents</b><br><br>
|
93
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/tents_solved.png" alt="Tents" width="
|
93
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/tents_solved.png" alt="Tents" width="140">
|
94
94
|
</a>
|
95
95
|
</td>
|
96
96
|
<td align="center">
|
97
97
|
<a href="#filling-puzzle-type-7"><b>Filling</b><br><br>
|
98
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/filling_solved.png" alt="Filling" width="
|
98
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/filling_solved.png" alt="Filling" width="140">
|
99
99
|
</a>
|
100
100
|
</td>
|
101
101
|
<td align="center">
|
102
102
|
<a href="#keen-puzzle-type-8"><b>Keen</b><br><br>
|
103
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/keen_solved.png" alt="Keen" width="
|
103
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/keen_solved.png" alt="Keen" width="140">
|
104
104
|
</a>
|
105
105
|
</td>
|
106
106
|
<td align="center">
|
107
107
|
<a href="#towers-puzzle-type-9"><b>Towers</b><br><br>
|
108
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/towers_solved.png" alt="Towers" width="
|
108
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/towers_solved.png" alt="Towers" width="140">
|
109
109
|
</a>
|
110
110
|
</td>
|
111
111
|
<td align="center">
|
112
112
|
<a href="#singles-puzzle-type-10"><b>Singles</b><br><br>
|
113
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/singles_solved.png" alt="Singles" width="
|
113
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/singles_solved.png" alt="Singles" width="140">
|
114
114
|
</a>
|
115
115
|
</td>
|
116
116
|
</tr>
|
117
117
|
<tr>
|
118
118
|
<td align="center">
|
119
119
|
<a href="#magnets-puzzle-type-11"><b>Magnets</b><br><br>
|
120
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/magnets_solved.png" alt="Magnets" width="
|
120
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/magnets_solved.png" alt="Magnets" width="140">
|
121
121
|
</a>
|
122
122
|
</td>
|
123
123
|
<td align="center">
|
124
124
|
<a href="#signpost-puzzle-type-12"><b>Signpost</b><br><br>
|
125
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/signpost_solved.png" alt="Signpost" width="
|
125
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/signpost_solved.png" alt="Signpost" width="140">
|
126
126
|
</a>
|
127
127
|
</td>
|
128
128
|
<td align="center">
|
129
129
|
<a href="#range-puzzle-type-13"><b>Range</b><br><br>
|
130
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/range_solved.png" alt="Range" width="
|
130
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/range_solved.png" alt="Range" width="140">
|
131
131
|
</a>
|
132
132
|
</td>
|
133
133
|
<td align="center">
|
134
134
|
<a href="#undead-puzzle-type-14"><b>Undead</b><br><br>
|
135
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/undead_solved.png" alt="Undead" width="
|
135
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/undead_solved.png" alt="Undead" width="140">
|
136
136
|
</a>
|
137
137
|
</td>
|
138
138
|
<td align="center">
|
139
139
|
<a href="#unruly-puzzle-type-15"><b>Unruly</b><br><br>
|
140
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/unruly_solved.png" alt="Unruly" width="
|
140
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/unruly_solved.png" alt="Unruly" width="140">
|
141
141
|
</a>
|
142
142
|
</td>
|
143
143
|
</tr>
|
144
144
|
<tr>
|
145
145
|
<td align="center">
|
146
146
|
<a href="#tracks-puzzle-type-16"><b>Tracks</b><br><br>
|
147
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/tracks_solved.png" alt="Tracks" width="
|
147
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/tracks_solved.png" alt="Tracks" width="140">
|
148
148
|
</a>
|
149
149
|
</td>
|
150
150
|
<td align="center">
|
151
151
|
<a href="#mosaic-puzzle-type-17"><b>Mosaic</b><br><br>
|
152
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/mosaic_solved.png" alt="Mosaic" width="
|
152
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/mosaic_solved.png" alt="Mosaic" width="140">
|
153
153
|
</a>
|
154
154
|
</td>
|
155
155
|
<td align="center">
|
156
156
|
<a href="#map-puzzle-type-18"><b>Map</b><br><br>
|
157
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/map_solved.png" alt="Map" width="
|
157
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/map_solved.png" alt="Map" width="140">
|
158
158
|
</a>
|
159
159
|
</td>
|
160
160
|
<td align="center">
|
161
161
|
<a href="#pearl-puzzle-type-19"><b>Pearl</b><br><br>
|
162
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/pearl_solved.png" alt="Pearl" width="
|
162
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/pearl_solved.png" alt="Pearl" width="140">
|
163
163
|
</a>
|
164
164
|
</td>
|
165
165
|
<td align="center">
|
166
166
|
<a href="#bridges-puzzle-type-20"><b>Bridges</b><br><br>
|
167
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/bridges_solved.png" alt="Bridges" width="
|
167
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/bridges_solved.png" alt="Bridges" width="140">
|
168
168
|
</a>
|
169
169
|
</td>
|
170
170
|
</tr>
|
171
171
|
<tr>
|
172
172
|
<td align="center">
|
173
173
|
<a href="#inertia-puzzle-type-21"><b>Inertia</b><br><br>
|
174
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/inertia_unsolved.png" alt="Inertia" width="
|
174
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/inertia_unsolved.png" alt="Inertia" width="140">
|
175
175
|
</a>
|
176
176
|
</td>
|
177
177
|
<td align="center">
|
178
178
|
<a href="#guess-puzzle-type-22"><b>Guess</b><br><br>
|
179
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/guess_3.png" alt="Guess" width="
|
179
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/guess_3.png" alt="Guess" width="140">
|
180
180
|
</a>
|
181
181
|
</td>
|
182
182
|
<td align="center">
|
183
183
|
<a href="#chess-range-puzzle-type-23"><b>Chess Range</b><br><br>
|
184
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/chess_range_unsolved.png" alt="Chess range" width="
|
184
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/chess_range_unsolved.png" alt="Chess range" width="140">
|
185
185
|
</a>
|
186
186
|
</td>
|
187
187
|
<td align="center">
|
188
188
|
<a href="#chess-solo-puzzle-type-24"><b>Chess Solo</b><br><br>
|
189
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/chess_solo_unsolved.png" alt="Chess solo" width="
|
189
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/chess_solo_unsolved.png" alt="Chess solo" width="140">
|
190
190
|
</a>
|
191
191
|
</td>
|
192
192
|
<td align="center">
|
193
193
|
<a href="#chess-melee-puzzle-type-25"><b>Chess Melee</b><br><br>
|
194
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/chess_melee_unsolved.png" alt="Chess melee" width="
|
194
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/chess_melee_unsolved.png" alt="Chess melee" width="140">
|
195
195
|
</a>
|
196
196
|
</td>
|
197
197
|
</tr>
|
198
198
|
<tr>
|
199
199
|
<td align="center">
|
200
200
|
<a href="#thermometers-puzzle-type-26"><b>Thermometers</b><br><br>
|
201
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/
|
201
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/thermometers_solved.png" alt="Thermometers" width="140">
|
202
|
+
</a>
|
203
|
+
</td>
|
204
|
+
<td align="center">
|
205
|
+
<a href="#aquarium-puzzle-type-27"><b>Aquarium</b><br><br>
|
206
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/aquarium_solved.png" alt="Aquarium" width="140">
|
202
207
|
</a>
|
203
208
|
</td>
|
204
209
|
</tr>
|
@@ -242,6 +247,7 @@ These are all the puzzles that are implemented in this repo. <br> Click on any o
|
|
242
247
|
- [Chess Solo (Puzzle Type #24)](#chess-solo-puzzle-type-24)
|
243
248
|
- [Chess Melee (Puzzle Type #25)](#chess-melee-puzzle-type-25)
|
244
249
|
- [Thermometers (Puzzle Type #26)](#thermometers-puzzle-type-26)
|
250
|
+
- [Aquarium (Puzzle Type #27)](#aquarium-puzzle-type-27)
|
245
251
|
- [Why SAT / CP-SAT?](#why-sat--cp-sat)
|
246
252
|
- [Testing](#testing)
|
247
253
|
- [Contributing](#contributing)
|
@@ -2091,6 +2097,7 @@ Time taken: 6.24 seconds
|
|
2091
2097
|
<summary><strong>Rules</strong></summary>
|
2092
2098
|
|
2093
2099
|
You have to fill some thermometers with mercury starting from the bulb and going toward the end without gaps.
|
2100
|
+
|
2094
2101
|
The numbers outside the grid show the number of filled cells horizontally and vertically.
|
2095
2102
|
|
2096
2103
|
</details>
|
@@ -2151,9 +2158,84 @@ status: OPTIMAL
|
|
2151
2158
|
Time taken: 0.01 seconds
|
2152
2159
|
```
|
2153
2160
|
|
2161
|
+
## Aquarium (Puzzle Type #27)
|
2162
|
+
|
2163
|
+
* [**Play online**](https://www.puzzle-aquarium.com/)
|
2164
|
+
|
2165
|
+
* [**Solver Code**][27]
|
2166
|
+
|
2167
|
+
<details>
|
2168
|
+
<summary><strong>Rules</strong></summary>
|
2169
|
+
|
2170
|
+
The puzzle is played on a rectangular grid divided into blocks called "aquariums"
|
2171
|
+
|
2172
|
+
You have to "fill" the aquariums with water up to a certain level or leave it empty.
|
2173
|
+
|
2174
|
+
The water level in each aquarium is one and the same across its full width
|
2175
|
+
|
2176
|
+
The numbers outside the grid show the number of filled cells horizontally and vertically.
|
2177
|
+
|
2178
|
+
</details>
|
2179
|
+
|
2180
|
+
**Unsolved puzzle**
|
2181
|
+
|
2182
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/aquarium_unsolved.png" alt="Aquarium unsolved" width="500">
|
2183
|
+
|
2184
|
+
Code to utilize this package and solve the puzzle:
|
2185
|
+
|
2186
|
+
(Note that this puzzle does not typically have a unique solution. Thus, we specify here that we only want the first valid solution that the solver finds.)
|
2187
|
+
|
2188
|
+
```python
|
2189
|
+
from puzzle_solver import aquarium_solver as solver
|
2190
|
+
board = np.array([
|
2191
|
+
['01', '01', '01', '01', '02', '02', '02', '03', '03', '03', '03', '04', '05', '05', '05'],
|
2192
|
+
['01', '02', '02', '02', '02', '06', '07', '07', '03', '08', '03', '04', '04', '05', '09'],
|
2193
|
+
['01', '01', '02', '11', '06', '06', '06', '12', '12', '08', '13', '13', '13', '09', '09'],
|
2194
|
+
['01', '11', '11', '11', '14', '06', '06', '12', '12', '15', '15', '13', '09', '09', '09'],
|
2195
|
+
['01', '01', '11', '11', '14', '12', '12', '12', '16', '16', '15', '13', '13', '17', '09'],
|
2196
|
+
['45', '11', '11', '14', '14', '12', '42', '42', '42', '15', '15', '13', '13', '17', '18'],
|
2197
|
+
['45', '11', '11', '14', '14', '12', '12', '43', '15', '15', '20', '13', '13', '17', '18'],
|
2198
|
+
['46', '46', '11', '19', '19', '19', '43', '43', '44', '20', '20', '20', '13', '17', '18'],
|
2199
|
+
['46', '22', '23', '23', '23', '19', '43', '21', '21', '24', '24', '24', '25', '17', '17'],
|
2200
|
+
['22', '22', '22', '23', '19', '19', '26', '24', '24', '24', '28', '28', '25', '17', '33'],
|
2201
|
+
['22', '22', '23', '23', '27', '27', '26', '26', '24', '24', '29', '29', '25', '25', '33'],
|
2202
|
+
['22', '22', '35', '27', '27', '26', '26', '26', '26', '30', '30', '30', '25', '34', '34'],
|
2203
|
+
['37', '22', '35', '35', '35', '35', '35', '26', '26', '30', '31', '31', '32', '32', '40'],
|
2204
|
+
['37', '37', '37', '36', '36', '35', '26', '26', '26', '40', '40', '40', '40', '40', '40'],
|
2205
|
+
['37', '37', '37', '37', '35', '35', '38', '38', '39', '39', '40', '40', '40', '41', '41'],
|
2206
|
+
])
|
2207
|
+
top = np.array([6, 6, 5, 3, 3, 4, 7, 6, 9, 6, 3, 4, 9, 6, 7])
|
2208
|
+
side = np.array([3, 5, 1, 2, 5, 3, 10, 10, 5, 3, 7, 3, 7, 8, 12])
|
2209
|
+
binst = solver.Board(board=board, top=top, side=side)
|
2210
|
+
solutions = binst.solve_and_print()
|
2211
|
+
```
|
2212
|
+
**Script Output**
|
2213
|
+
|
2214
|
+
```python
|
2215
|
+
Solution found
|
2216
|
+
[['0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '1' '1' '1']
|
2217
|
+
['0' '0' '0' '0' '0' '0' '0' '0' '1' '0' '1' '1' '1' '1' '0']
|
2218
|
+
['0' '0' '0' '0' '0' '0' '0' '0' '0' '1' '0' '0' '0' '0' '0']
|
2219
|
+
['0' '0' '0' '0' '0' '1' '1' '0' '0' '0' '0' '0' '0' '0' '0']
|
2220
|
+
['1' '1' '0' '0' '0' '0' '0' '0' '1' '1' '0' '0' '0' '0' '1']
|
2221
|
+
['0' '0' '0' '0' '0' '0' '1' '1' '1' '0' '0' '0' '0' '0' '0']
|
2222
|
+
['1' '1' '1' '0' '0' '1' '1' '0' '1' '1' '0' '1' '1' '0' '1']
|
2223
|
+
['1' '1' '1' '0' '0' '0' '1' '1' '0' '1' '1' '1' '1' '0' '1']
|
2224
|
+
['1' '0' '0' '0' '0' '0' '1' '1' '1' '0' '0' '0' '1' '0' '0']
|
2225
|
+
['0' '0' '0' '0' '1' '1' '0' '0' '0' '0' '0' '0' '1' '0' '0']
|
2226
|
+
['0' '0' '1' '1' '0' '0' '0' '0' '1' '1' '0' '0' '1' '1' '1']
|
2227
|
+
['0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '0' '1' '1' '1']
|
2228
|
+
['0' '1' '0' '0' '0' '0' '0' '1' '1' '0' '1' '1' '1' '1' '0']
|
2229
|
+
['1' '1' '1' '1' '1' '0' '1' '1' '1' '0' '0' '0' '0' '0' '0']
|
2230
|
+
['1' '1' '1' '1' '1' '1' '1' '1' '1' '1' '0' '0' '0' '1' '1']]
|
2231
|
+
Solutions found: 1
|
2232
|
+
status: OPTIMAL
|
2233
|
+
Time taken: 0.02 seconds
|
2234
|
+
```
|
2235
|
+
|
2154
2236
|
**Solved puzzle**
|
2155
2237
|
|
2156
|
-
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/
|
2238
|
+
<img src="https://raw.githubusercontent.com/Ar-Kareem/puzzle_solver/master/images/aquarium_solved.png" alt="Aquarium solved" width="500">
|
2157
2239
|
|
2158
2240
|
---
|
2159
2241
|
|
@@ -2234,3 +2316,4 @@ Issues and PRs welcome!
|
|
2234
2316
|
[24]: https://github.com/Ar-Kareem/puzzle_solver/tree/master/src/puzzle_solver/puzzles/chess_range#chess-solo-puzzle-type-24 "puzzle_solver/src/puzzle_solver/puzzles/chess_range at master · Ar-Kareem/puzzle_solver · GitHub"
|
2235
2317
|
[25]: https://github.com/Ar-Kareem/puzzle_solver/tree/master/src/puzzle_solver/puzzles/chess_range#chess-melee-puzzle-type-25 "puzzle_solver/src/puzzle_solver/puzzles/chess_range at master · Ar-Kareem/puzzle_solver · GitHub"
|
2236
2318
|
[26]: https://github.com/Ar-Kareem/puzzle_solver/tree/master/src/puzzle_solver/puzzles/thermometers "puzzle_solver/src/puzzle_solver/puzzles/thermometers at master · Ar-Kareem/puzzle_solver · GitHub"
|
2319
|
+
[27]: https://github.com/Ar-Kareem/puzzle_solver/tree/master/src/puzzle_solver/puzzles/aquarium "puzzle_solver/src/puzzle_solver/puzzles/aquarium at master · Ar-Kareem/puzzle_solver · GitHub"
|