3 ms·
Using my CL based sudoku solver [1], I got the following solution. The solution is valid but different from what is shown in the video. IIRC, a sudoku board can
by deepaksurti 6y ago
Using my CL based sudoku solver [1], I got the following solution. The solution is valid but different from what is shown in the video. IIRC, a sudoku board can have multiple solutions but anyone out here can explain why so? I am no sudoku expert or enjoying solving sudokus anyways!
[1] https://github.com/dmsurti/sudoku https://github.com/dmsurti/sudoku
```
(setf board
#(0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 1 0 0 0 0 0 0
0 0 0 0 0 0 2 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0))
```
```
* (sudoku:print-board (sudoku:solve board))
1 2 5 | 6 4 7 | 8 9 3
8 3 4 | 5 9 1 | 6 7 2
9 7 6 | 3 2 8 | 4 5 1
- - - - - - - - - - -
5 8 9 | 2 3 4 | 1 6 7
2 6 1 | 7 8 9 | 3 4 5
3 4 7 | 1 5 6 | 2 8 9
- - - - - - - - - - -
4 9 2 | 8 1 5 | 7 3 6
6 1 8 | 9 7 3 | 5 2 4
7 5 3 | 4 6 2 | 9 1 8
```
edit: formatting
- hummusandsushi 6y agoYour solution doesn't respect the knight's move and king's move constraints, which cause the original puzzle to have exactly one solution.
- Marazan 6y agoYou have consecutive numbers appearing next to each other. One of the constraints is that no consecutive numbers can appear orthogonally. This isn't a standard sudoku, there are extra rules. There would be a huge number of valid solutions to the board under regular sudoku rules. EDIT: and you've missed the King's move constraint as well and I presume the Knight's move as well.
- prawn 6y agoThe first line of your result fails the orthogonal adjacent rule of this puzzle eight times!
- boomlinde 6y agoYour sudoku solver is solving a different puzzle altogether from the one posed in the video. Sudoku puzzles also don't normally have multiple solutions. The smallest known Sudoku satisfying that constraint have 17 clues. Offering only two clues is possible here because of the additional placement constraints.