You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
checkEmptyBlockSudoku :: Int -> IO ()
checkEmptyBlockSudoku n = do [r] <- rsolveNs [emptyN]
showNode r
xs <- shuffleBlocks
-- xs <- blocksToEmpty n
let xs' = take n xs
let r' = cleanBlocks r xs'
if uniqueSol r' then do
s <- genProblem r'
showNode s
else checkEmptyBlockSudoku n
better
checkEmptyBlockSudoku :: Int -> IO ()
checkEmptyBlockSudoku n = do [r] <- rsolveNs [emptyN]
showNode r
xs <- shuffleBlocks
-- xs <- blocksToEmpty n
let xs' = take n xs
let r' = cleanBlocks r xs'
s <- genProblem r'
if uniqueSol s then do
showNode s
else checkEmptyBlockSudoku n
In the old way you will miss possible unique solutions.
The text was updated successfully, but these errors were encountered:
You don't need this because you can always call freeAtPos for getting [Value]. But I admitted this is expensive. But missed a remark like that it is ugly to have to similar types Constraint and Constrnt. It looks as if the refactoring task is not finished.
Exercise 2. Good but refactoring can be more complete.
In many more places it is possible to replace
Constraints
by[Position]
Exercise 3
must become
Exercise 4
better
In the old way you will miss possible unique solutions.
The text was updated successfully, but these errors were encountered: