Skip to content

Lab 5 #5

@BertLisser

Description

@BertLisser

Exercise 2. Very good but refactoring can be more complete.
In many more places is it possible to replace Constraints by [Position]

type Node = (Sudoku,[Position])
prune :: (Row,Column,Value)
-> [Position] -> [Position]
constraints :: Sudoku -> [Position]

Exercise 4.

randomSudoku :: IO ()
randomSudoku = do [r] <- rsolveNs [emptyN]
                  showNode r
                  sudokuEmptyblocks <- deleteBlocks r
                  s <- genProblem sudokuEmptyblocks --making this a sudoku problem
                  showNode s
                  print (uniqueSol s)   --- this must be added. Otherwise you cannot see 
--- that the solution is unique

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions