Nice one Grrr1337
Thanks!
FWIW, here's another way to write the 'ValidRowColp' function:(defun validrowcolp
( l
) )
Wow, cool - I didn't thought of this!
Lee, is there a reason to use:
(mapcar '(lambda ( n ) (nth n l)) (vl-sort-i l '<))
rather than:
(vl-sort l '<)
because now I think that the simpliest way to write it would be:
(defun validrowcolp ( l )
(equal (vl-sort l '<) '(1 2 3 4 5 6 7 8 9))
)
wouldn't came up with this, without your suggestion
[since I might overthinked my version of
ValidRowColp].
Just for fun, here are two more ways to group the matrix into the 3x3 submatrices, depending on the order desired:
...
Thats very cool!
I think I'm there:
...
Though, the algorithm is essentially brute-force, so for sparse inputs be prepared to wait...
Lee, are you sure it doesn't get into endless loop? :
(sudoku
'(
(6 nil nil nil 8 5 1 nil nil)
(nil nil nil nil nil nil nil 5 3)
(4 nil nil nil nil 9 8 nil nil)
(nil nil nil nil nil nil nil 1 nil)
(nil 8 nil 3 2 6 nil 7 nil)
(nil 3 nil 1 nil nil nil nil nil)
(nil nil 7 nil nil nil nil nil 4)
(nil 5 nil nil nil nil nil nil nil)
(nil nil nil 9 4 nil nil nil 2)
)
)
BTW, I have an idea about the actual game (which includes DCL) but I must have more free time to write it.
Although it doesn't include sudoku solvers - just initial list of unsolved sudoku, like the above, along with user input and
IsSudokuValid checking.