|
1 | 1 | <header> |
2 | 2 | <h1 align="center"> |
3 | | - <a href="https://github.com/guanghechen/algorithm.ts/tree/release-2.x.x/packages/sudoku#readme">@algorithm.ts/sudoku</a> |
| 3 | + <a href="https://github.com/guanghechen/algorithm.ts/tree/release-3.x.x/packages/sudoku#readme">@algorithm.ts/sudoku</a> |
4 | 4 | </h1> |
5 | 5 | <div align="center"> |
6 | 6 | <a href="https://www.npmjs.com/package/@algorithm.ts/sudoku"> |
|
95 | 95 | const solver = new SudokuSolver({ childMatrixSize: 4 }) |
96 | 96 |
|
97 | 97 | const puzzle: ISudokuBoard = [ |
98 | | - [ 2, 3, 14, -1, 8, 6, -1, -1, -1, 13, -1, -1, -1, 10, 12, -1], |
99 | | - [ 0, -1, -1, -1, -1, -1, 1, 9, -1, -1, 4, -1, 8, -1, -1, 2], |
100 | | - [-1, -1, -1, 6, 7, -1, 2, -1, -1, -1, 10, 1, -1, 0, -1, 15], |
101 | | - [-1, 8, -1, -1, -1, -1, 12, -1, -1, 5, 0, 7, 4, -1, 1, 6], |
102 | | - [ 7, 1, -1, 3, -1, 4, 10, 14, -1, -1, -1, -1, 2, -1, 15, 9], |
103 | | - [14, 12, -1, -1, 2, 3, -1, -1, 1, -1, 7, -1, -1, 6, 13, -1], |
104 | | - [10, 2, 5, -1, -1, 0, 7, -1, 3, -1, -1, 8, 11, 1, -1, 4], |
105 | | - [-1, 13, 6, -1, -1, -1, -1, 1, -1, -1, 14, 2, -1, 3, 7, -1], |
106 | | - [-1, -1, -1, 2, 1, -1, -1, -1, -1, -1, 8, 9, 14, 7, -1, -1], |
107 | | - [ 8, 9, 10, -1, 3, -1, -1, 2, 6, -1, 11, -1, -1, -1, 5, 0], |
108 | | - [ 1, -1, 3, 5, -1, -1, -1, -1, 4, 0, -1, -1, -1, 11, -1, 12], |
109 | | - [ 6, -1, -1, 4, 5, -1, 15, 11, 14, -1, 1, -1, 13, 9, 8, -1], |
110 | | - [-1, 6, -1, -1, -1, 2, -1, 12, -1, -1, -1, 14, 9, -1, 0, 13], |
111 | | - [-1, -1, 0, 7, -1, 9, 13, 8, -1, -1, 3, -1, -1, 2, 6, 14], |
112 | | - [-1, -1, -1, 8, -1, 11, -1, -1, -1, 12, -1, -1, 15, 5, 3, 1], |
113 | | - [ 3, -1, -1, -1, -1, -1, -1, -1, 9, 15, 2, 0, -1, 8, -1, 11] |
| 98 | + 2, 3, 14, -1, 8, 6, -1, -1, -1, 13, -1, -1, -1, 10, 12, -1, |
| 99 | + 0, -1, -1, -1, -1, -1, 1, 9, -1, -1, 4, -1, 8, -1, -1, 2, |
| 100 | + -1, -1, -1, 6, 7, -1, 2, -1, -1, -1, 10, 1, -1, 0, -1, 15, |
| 101 | + -1, 8, -1, -1, -1, -1, 12, -1, -1, 5, 0, 7, 4, -1, 1, 6, |
| 102 | + 7, 1, -1, 3, -1, 4, 10, 14, -1, -1, -1, -1, 2, -1, 15, 9, |
| 103 | + 14, 12, -1, -1, 2, 3, -1, -1, 1, -1, 7, -1, -1, 6, 13, -1, |
| 104 | + 10, 2, 5, -1, -1, 0, 7, -1, 3, -1, -1, 8, 11, 1, -1, 4, |
| 105 | + -1, 13, 6, -1, -1, -1, -1, 1, -1, -1, 14, 2, -1, 3, 7, -1, |
| 106 | + -1, -1, -1, 2, 1, -1, -1, -1, -1, -1, 8, 9, 14, 7, -1, -1, |
| 107 | + 8, 9, 10, -1, 3, -1, -1, 2, 6, -1, 11, -1, -1, -1, 5, 0, |
| 108 | + 1, -1, 3, 5, -1, -1, -1, -1, 4, 0, -1, -1, -1, 11, -1, 12, |
| 109 | + 6, -1, -1, 4, 5, -1, 15, 11, 14, -1, 1, -1, 13, 9, 8, -1, |
| 110 | + -1, 6, -1, -1, -1, 2, -1, 12, -1, -1, -1, 14, 9, -1, 0, 13, |
| 111 | + -1, -1, 0, 7, -1, 9, 13, 8, -1, -1, 3, -1, -1, 2, 6, 14, |
| 112 | + -1, -1, -1, 8, -1, 11, -1, -1, -1, 12, -1, -1, 15, 5, 3, 1, |
| 113 | + 3, -1, -1, -1, -1, -1, -1, -1, 9, 15, 2, 0, -1, 8, -1, 11 |
114 | 114 | ] |
115 | 115 |
|
116 | 116 | solver.solve(puzzle, null) // => true |
117 | 117 |
|
118 | 118 | const solution: ISudokuBoard = createSudokuBoard(16) |
119 | 119 | solver.solve(puzzle, solution) // => true |
120 | 120 |
|
121 | | - solution === [ |
122 | | - [ 2, 3, 14, 1, 8, 6, 0, 4, 11, 13, 9, 15, 5, 10, 12, 7], |
123 | | - [ 0, 5, 7, 10, 14, 15, 1, 9, 12, 3, 4, 6, 8, 13, 11, 2], |
124 | | - [12, 11, 4, 6, 7, 5, 2, 13, 8, 14, 10, 1, 3, 0, 9, 15], |
125 | | - [15, 8, 9, 13, 11, 10, 12, 3, 2, 5, 0, 7, 4, 14, 1, 6], |
126 | | - [ 7, 1, 8, 3, 6, 4, 10, 14, 0, 11, 13, 5, 2, 12, 15, 9], |
127 | | - [14, 12, 15, 11, 2, 3, 9, 5, 1, 4, 7, 10, 0, 6, 13, 8], |
128 | | - [10, 2, 5, 9, 13, 0, 7, 15, 3, 6, 12, 8, 11, 1, 14, 4], |
129 | | - [ 4, 13, 6, 0, 12, 8, 11, 1, 15, 9, 14, 2, 10, 3, 7, 5], |
130 | | - [13, 15, 11, 2, 1, 12, 6, 0, 5, 10, 8, 9, 14, 7, 4, 3], |
131 | | - [ 8, 9, 10, 14, 3, 13, 4, 2, 6, 7, 11, 12, 1, 15, 5, 0], |
132 | | - [ 1, 7, 3, 5, 9, 14, 8, 10, 4, 0, 15, 13, 6, 11, 2, 12], |
133 | | - [ 6, 0, 12, 4, 5, 7, 15, 11, 14, 2, 1, 3, 13, 9, 8, 10], |
134 | | - [11, 6, 1, 15, 10, 2, 3, 12, 7, 8, 5, 14, 9, 4, 0, 13], |
135 | | - [ 5, 4, 0, 7, 15, 9, 13, 8, 10, 1, 3, 11, 12, 2, 6, 14], |
136 | | - [ 9, 10, 2, 8, 0, 11, 14, 7, 13, 12, 6, 4, 15, 5, 3, 1], |
137 | | - [ 3, 14, 13, 12, 4, 1, 5, 6, 9, 15, 2, 0, 7, 8, 10, 11] |
138 | | - ] // true |
| 121 | + solution |
| 122 | + /** ===> |
| 123 | + * [ |
| 124 | + * 2, 3, 14, 1, 8, 6, 0, 4, 11, 13, 9, 15, 5, 10, 12, 7, |
| 125 | + * 0, 5, 7, 10, 14, 15, 1, 9, 12, 3, 4, 6, 8, 13, 11, 2, |
| 126 | + * 12, 11, 4, 6, 7, 5, 2, 13, 8, 14, 10, 1, 3, 0, 9, 15, |
| 127 | + * 15, 8, 9, 13, 11, 10, 12, 3, 2, 5, 0, 7, 4, 14, 1, 6, |
| 128 | + * 7, 1, 8, 3, 6, 4, 10, 14, 0, 11, 13, 5, 2, 12, 15, 9, |
| 129 | + * 14, 12, 15, 11, 2, 3, 9, 5, 1, 4, 7, 10, 0, 6, 13, 8, |
| 130 | + * 10, 2, 5, 9, 13, 0, 7, 15, 3, 6, 12, 8, 11, 1, 14, 4, |
| 131 | + * 4, 13, 6, 0, 12, 8, 11, 1, 15, 9, 14, 2, 10, 3, 7, 5, |
| 132 | + * 13, 15, 11, 2, 1, 12, 6, 0, 5, 10, 8, 9, 14, 7, 4, 3, |
| 133 | + * 8, 9, 10, 14, 3, 13, 4, 2, 6, 7, 11, 12, 1, 15, 5, 0, |
| 134 | + * 1, 7, 3, 5, 9, 14, 8, 10, 4, 0, 15, 13, 6, 11, 2, 12, |
| 135 | + * 6, 0, 12, 4, 5, 7, 15, 11, 14, 2, 1, 3, 13, 9, 8, 10, |
| 136 | + * 11, 6, 1, 15, 10, 2, 3, 12, 7, 8, 5, 14, 9, 4, 0, 13, |
| 137 | + * 5, 4, 0, 7, 15, 9, 13, 8, 10, 1, 3, 11, 12, 2, 6, 14, |
| 138 | + * 9, 10, 2, 8, 0, 11, 14, 7, 13, 12, 6, 4, 15, 5, 3, 1, |
| 139 | + * 3, 14, 13, 12, 4, 1, 5, 6, 9, 15, 2, 0, 7, 8, 10, 11 |
| 140 | + * ] |
| 141 | + */ |
139 | 142 | ``` |
140 | 143 |
|
141 | 144 |
|
|
163 | 166 | ```json |
164 | 167 | { |
165 | 168 | "puzzle": [ |
166 | | - [ 8, -1, 6, 1, 0, 2, 3, 5, -1], |
167 | | - [ 0, -1, 5, -1, 4, -1, 8, 1, 7], |
168 | | - [ 4, 3, 1, 8, -1, -1, 2, 6, 0], |
169 | | - [-1, 0, 7, 4, -1, 1, 5, 8, 2], |
170 | | - [ 2, 1, 4, 5, 3, -1, -1, 7, 6], |
171 | | - [ 5, 6, 8, 0, 2, 7, 4, 3, 1], |
172 | | - [ 1, 4, 3, 2, -1, 6, 7, 0, 8], |
173 | | - [ 6, 5, 0, 7, 8, 4, 1, 2, 3], |
174 | | - [-1, -1, 2, 3, -1, -1, 6, 4, 5] |
| 169 | + 8, -1, 6, 1, 0, 2, 3, 5, -1, |
| 170 | + 0, -1, 5, -1, 4, -1, 8, 1, 7, |
| 171 | + 4, 3, 1, 8, -1, -1, 2, 6, 0, |
| 172 | + -1, 0, 7, 4, -1, 1, 5, 8, 2, |
| 173 | + 2, 1, 4, 5, 3, -1, -1, 7, 6, |
| 174 | + 5, 6, 8, 0, 2, 7, 4, 3, 1, |
| 175 | + 1, 4, 3, 2, -1, 6, 7, 0, 8, |
| 176 | + 6, 5, 0, 7, 8, 4, 1, 2, 3, |
| 177 | + -1, -1, 2, 3, -1, -1, 6, 4, 5 |
175 | 178 | ], |
176 | 179 | "solution": [ |
177 | | - [8, 7, 6, 1, 0, 2, 3, 5, 4], |
178 | | - [0, 2, 5, 6, 4, 3, 8, 1, 7], |
179 | | - [4, 3, 1, 8, 7, 5, 2, 6, 0], |
180 | | - [3, 0, 7, 4, 6, 1, 5, 8, 2], |
181 | | - [2, 1, 4, 5, 3, 8, 0, 7, 6], |
182 | | - [5, 6, 8, 0, 2, 7, 4, 3, 1], |
183 | | - [1, 4, 3, 2, 5, 6, 7, 0, 8], |
184 | | - [6, 5, 0, 7, 8, 4, 1, 2, 3], |
185 | | - [7, 8, 2, 3, 1, 0, 6, 4, 5] |
| 180 | + 8, 7, 6, 1, 0, 2, 3, 5, 4, |
| 181 | + 0, 2, 5, 6, 4, 3, 8, 1, 7, |
| 182 | + 4, 3, 1, 8, 7, 5, 2, 6, 0, |
| 183 | + 3, 0, 7, 4, 6, 1, 5, 8, 2, |
| 184 | + 2, 1, 4, 5, 3, 8, 0, 7, 6, |
| 185 | + 5, 6, 8, 0, 2, 7, 4, 3, 1, |
| 186 | + 1, 4, 3, 2, 5, 6, 7, 0, 8, |
| 187 | + 6, 5, 0, 7, 8, 4, 1, 2, 3, |
| 188 | + 7, 8, 2, 3, 1, 0, 6, 4, 5 |
186 | 189 | ] |
187 | 190 | } |
188 | 191 | ``` |
|
198 | 201 | ```json |
199 | 202 | { |
200 | 203 | "puzzle": [ |
201 | | - [-1, -1, -1, -1, -1, 8, -1, -1, 4], |
202 | | - [-1, -1, -1, 3, -1, -1, 5, 8, -1], |
203 | | - [-1, -1, -1, 6, 4, -1, 0, -1, -1], |
204 | | - [-1, -1, -1, -1, 2, -1, 6, -1, -1], |
205 | | - [-1, 0, -1, -1, -1, -1, 7, 3, 5], |
206 | | - [-1, 7, -1, -1, 3, -1, -1, -1, -1], |
207 | | - [ 3, -1, -1, -1, -1, 2, -1, -1, 0], |
208 | | - [-1, -1, -1, 8, 6, 5, -1, -1, -1], |
209 | | - [ 2, -1, 4, -1, -1, -1, -1, -1, -1] |
| 204 | + -1, -1, -1, -1, -1, 8, -1, -1, 4, |
| 205 | + -1, -1, -1, 3, -1, -1, 5, 8, -1, |
| 206 | + -1, -1, -1, 6, 4, -1, 0, -1, -1, |
| 207 | + -1, -1, -1, -1, 2, -1, 6, -1, -1, |
| 208 | + -1, 0, -1, -1, -1, -1, 7, 3, 5, |
| 209 | + -1, 7, -1, -1, 3, -1, -1, -1, -1, |
| 210 | + 3, -1, -1, -1, -1, 2, -1, -1, 0, |
| 211 | + -1, -1, -1, 8, 6, 5, -1, -1, -1, |
| 212 | + 2, -1, 4, -1, -1, -1, -1, -1, -1 |
210 | 213 | ], |
211 | 214 | "solution": [ |
212 | | - [0, 6, 1, 2, 5, 8, 3, 7, 4], |
213 | | - [4, 2, 7, 3, 0, 1, 5, 8, 6], |
214 | | - [8, 3, 5, 6, 4, 7, 0, 2, 1], |
215 | | - [5, 4, 3, 7, 2, 0, 6, 1, 8], |
216 | | - [6, 0, 2, 1, 8, 4, 7, 3, 5], |
217 | | - [1, 7, 8, 5, 3, 6, 4, 0, 2], |
218 | | - [3, 8, 6, 4, 7, 2, 1, 5, 0], |
219 | | - [7, 1, 0, 8, 6, 5, 2, 4, 3], |
220 | | - [2, 5, 4, 0, 1, 3, 8, 6, 7] |
| 215 | + 0, 6, 1, 2, 5, 8, 3, 7, 4, |
| 216 | + 4, 2, 7, 3, 0, 1, 5, 8, 6, |
| 217 | + 8, 3, 5, 6, 4, 7, 0, 2, 1, |
| 218 | + 5, 4, 3, 7, 2, 0, 6, 1, 8, |
| 219 | + 6, 0, 2, 1, 8, 4, 7, 3, 5, |
| 220 | + 1, 7, 8, 5, 3, 6, 4, 0, 2, |
| 221 | + 3, 8, 6, 4, 7, 2, 1, 5, 0, |
| 222 | + 7, 1, 0, 8, 6, 5, 2, 4, 3, |
| 223 | + 2, 5, 4, 0, 1, 3, 8, 6, 7 |
221 | 224 | ] |
222 | 225 | } |
223 | 226 | ``` |
|
237 | 240 | ```json |
238 | 241 | { |
239 | 242 | "puzzle": [ |
240 | | - [-1, -1, -1, 12, -1, 5, -1, 9, -1, -1, 6, -1, -1, 1, -1, 14], |
241 | | - [-1, 2, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 15, -1], |
242 | | - [-1, -1, 8, -1, 12, 13, 4, 7, 2, -1, -1, -1, -1, -1, -1, -1], |
243 | | - [ 7, -1, -1, -1, -1, -1, -1, 14, -1, -1, -1, 12, -1, -1, -1, -1], |
244 | | - [ 4, -1, 15, -1, 6, -1, -1, -1, -1, -1, 11, -1, 3, -1, -1, -1], |
245 | | - [-1, 8, 10, 14, -1, -1, -1, -1, 5, 13, -1, -1, -1, 9, -1, -1], |
246 | | - [-1, -1, 6, 11, 3, 14, -1, -1, 0, 2, -1, 4, -1, -1, -1, 15], |
247 | | - [-1, 5, 13, -1, -1, 7, -1, -1, 9, -1, -1, 3, 2, -1, 10, -1], |
248 | | - [-1, -1, -1, -1, -1, -1, 14, -1, 6, 9, -1, -1, 10, 8, -1, -1], |
249 | | - [-1, -1, 14, 0, 7, 3, -1, 2, -1, 10, -1, -1, 15, 13, -1, 9], |
250 | | - [-1, 9, 7, -1, -1, -1, -1, 12, -1, 15, -1, 1, -1, -1, 0, -1], |
251 | | - [11, -1, 3, -1, -1, 0, -1, 15, 14, 5, -1, -1, -1, 2, 12, 6], |
252 | | - [-1, -1, 0, 13, -1, -1, -1, 5, -1, 11, 9, -1, 4, -1, 6, 3], |
253 | | - [-1, -1, 2, -1, -1, -1, 10, -1, 15, 6, -1, -1, 14, -1, -1, -1], |
254 | | - [-1, -1, -1, -1, 15, 12, -1, -1, -1, 4, 7, -1, -1, -1, 9, -1], |
255 | | - [ 6, -1, -1, -1, -1, -1, 8, -1, -1, -1, 5, -1, -1, 0, -1, -1] |
| 243 | + -1, -1, -1, 12, -1, 5, -1, 9, -1, -1, 6, -1, -1, 1, -1, 14, |
| 244 | + -1, 2, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 15, -1, |
| 245 | + -1, -1, 8, -1, 12, 13, 4, 7, 2, -1, -1, -1, -1, -1, -1, -1, |
| 246 | + 7, -1, -1, -1, -1, -1, -1, 14, -1, -1, -1, 12, -1, -1, -1, -1, |
| 247 | + 4, -1, 15, -1, 6, -1, -1, -1, -1, -1, 11, -1, 3, -1, -1, -1, |
| 248 | + -1, 8, 10, 14, -1, -1, -1, -1, 5, 13, -1, -1, -1, 9, -1, -1, |
| 249 | + -1, -1, 6, 11, 3, 14, -1, -1, 0, 2, -1, 4, -1, -1, -1, 15, |
| 250 | + -1, 5, 13, -1, -1, 7, -1, -1, 9, -1, -1, 3, 2, -1, 10, -1, |
| 251 | + -1, -1, -1, -1, -1, -1, 14, -1, 6, 9, -1, -1, 10, 8, -1, -1, |
| 252 | + -1, -1, 14, 0, 7, 3, -1, 2, -1, 10, -1, -1, 15, 13, -1, 9, |
| 253 | + -1, 9, 7, -1, -1, -1, -1, 12, -1, 15, -1, 1, -1, -1, 0, -1, |
| 254 | + 11, -1, 3, -1, -1, 0, -1, 15, 14, 5, -1, -1, -1, 2, 12, 6, |
| 255 | + -1, -1, 0, 13, -1, -1, -1, 5, -1, 11, 9, -1, 4, -1, 6, 3, |
| 256 | + -1, -1, 2, -1, -1, -1, 10, -1, 15, 6, -1, -1, 14, -1, -1, -1, |
| 257 | + -1, -1, -1, -1, 15, 12, -1, -1, -1, 4, 7, -1, -1, -1, 9, -1, |
| 258 | + 6, -1, -1, -1, -1, -1, 8, -1, -1, -1, 5, -1, -1, 0, -1, -1 |
256 | 259 | ], |
257 | 260 | "solution": [ |
258 | | - [10, 3, 11, 12, 8, 5, 2, 9, 4, 7, 6, 15, 0, 1, 13, 14], |
259 | | - [13, 2, 4, 9, 1, 6, 3, 0, 11, 8, 14, 5, 12, 7, 15, 10], |
260 | | - [ 0, 14, 8, 15, 12, 13, 4, 7, 2, 1, 10, 9, 6, 3, 11, 5], |
261 | | - [ 7, 6, 1, 5, 11, 10, 15, 14, 13, 0, 3, 12, 9, 4, 8, 2], |
262 | | - [ 4, 0, 15, 2, 6, 9, 1, 13, 7, 12, 11, 10, 3, 5, 14, 8], |
263 | | - [ 3, 8, 10, 14, 2, 15, 12, 4, 5, 13, 1, 6, 11, 9, 7, 0], |
264 | | - [ 9, 7, 6, 11, 3, 14, 5, 10, 0, 2, 8, 4, 13, 12, 1, 15], |
265 | | - [12, 5, 13, 1, 0, 7, 11, 8, 9, 14, 15, 3, 2, 6, 10, 4], |
266 | | - [15, 13, 12, 4, 5, 11, 14, 1, 6, 9, 2, 0, 10, 8, 3, 7], |
267 | | - [ 5, 1, 14, 0, 7, 3, 6, 2, 8, 10, 12, 11, 15, 13, 4, 9], |
268 | | - [ 2, 9, 7, 6, 10, 8, 13, 12, 3, 15, 4, 1, 5, 14, 0, 11], |
269 | | - [11, 10, 3, 8, 4, 0, 9, 15, 14, 5, 13, 7, 1, 2, 12, 6], |
270 | | - [ 1, 12, 0, 13, 14, 2, 7, 5, 10, 11, 9, 8, 4, 15, 6, 3], |
271 | | - [ 8, 4, 2, 7, 9, 1, 10, 3, 15, 6, 0, 13, 14, 11, 5, 12], |
272 | | - [14, 11, 5, 3, 15, 12, 0, 6, 1, 4, 7, 2, 8, 10, 9, 13], |
273 | | - [ 6, 15, 9, 10, 13, 4, 8, 11, 12, 3, 5, 14, 7, 0, 2, 1] |
| 261 | + 10, 3, 11, 12, 8, 5, 2, 9, 4, 7, 6, 15, 0, 1, 13, 14, |
| 262 | + 13, 2, 4, 9, 1, 6, 3, 0, 11, 8, 14, 5, 12, 7, 15, 10, |
| 263 | + 0, 14, 8, 15, 12, 13, 4, 7, 2, 1, 10, 9, 6, 3, 11, 5, |
| 264 | + 7, 6, 1, 5, 11, 10, 15, 14, 13, 0, 3, 12, 9, 4, 8, 2, |
| 265 | + 4, 0, 15, 2, 6, 9, 1, 13, 7, 12, 11, 10, 3, 5, 14, 8, |
| 266 | + 3, 8, 10, 14, 2, 15, 12, 4, 5, 13, 1, 6, 11, 9, 7, 0, |
| 267 | + 9, 7, 6, 11, 3, 14, 5, 10, 0, 2, 8, 4, 13, 12, 1, 15, |
| 268 | + 12, 5, 13, 1, 0, 7, 11, 8, 9, 14, 15, 3, 2, 6, 10, 4, |
| 269 | + 15, 13, 12, 4, 5, 11, 14, 1, 6, 9, 2, 0, 10, 8, 3, 7, |
| 270 | + 5, 1, 14, 0, 7, 3, 6, 2, 8, 10, 12, 11, 15, 13, 4, 9, |
| 271 | + 2, 9, 7, 6, 10, 8, 13, 12, 3, 15, 4, 1, 5, 14, 0, 11, |
| 272 | + 11, 10, 3, 8, 4, 0, 9, 15, 14, 5, 13, 7, 1, 2, 12, 6, |
| 273 | + 1, 12, 0, 13, 14, 2, 7, 5, 10, 11, 9, 8, 4, 15, 6, 3, |
| 274 | + 8, 4, 2, 7, 9, 1, 10, 3, 15, 6, 0, 13, 14, 11, 5, 12, |
| 275 | + 14, 11, 5, 3, 15, 12, 0, 6, 1, 4, 7, 2, 8, 10, 9, 13, |
| 276 | + 6, 15, 9, 10, 13, 4, 8, 11, 12, 3, 5, 14, 7, 0, 2, 1 |
274 | 277 | ] |
275 | 278 | } |
276 | 279 | ``` |
|
283 | 286 | * [当你想来一把数独 | 光和尘](https://me.guanghechen.com/post/game/sudoku/) |
284 | 287 |
|
285 | 288 |
|
286 | | -[homepage]: https://github.com/guanghechen/algorithm.ts/tree/release-2.x.x/packages/sudoku#readme |
| 289 | +[homepage]: https://github.com/guanghechen/algorithm.ts/tree/release-3.x.x/packages/sudoku#readme |
287 | 290 | [knuth-shuffle]: https://me.guanghechen.com/post/algorithm/shuffle/#heading-knuth-shuffle |
288 | 291 | [dlx]: https://me.guanghechen.com/post/algorithm/shuffle/#heading-dlx |
0 commit comments