Open BertLisser opened 5 years ago
Could you please elaborate on how you envision the refactoring of Constraint
?
Given our types
type Position = (Row,Column)
type Constrnt = [[Position]] -- Mind the missing 'ai' in the spelling as this is copied from the assignment
the refactoring of type Constraint = (Row,Column,[Value])
would lead to type Constraint = (Position,[Value])
which would lead to
type Node = (Sudoku,[(Position,[Value])])
which is different then the suggested refactoring in the issue!
type Node = (Sudoku,[Position])
The list of values is missing in this case.
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.