Hi take a look at this thread already processing this subject And also this thread might be of intrest.
Im trying to write a function
candidates :: Sudoku -> Pos -> [Int]
that given a Sudoku
data Sudoku = Sudoku { rows :: [[Maybe Int]] }
deriving ( Show, Eq )
and a position (type Pos = (Int, Int)
)
determines what numbers that you can write there, for example in a sudoku row that already contains (1,2,4,7,9,x,x) you cant write any of the already existing numbers in the last row. Also the other problem is to check the hight as well as the width so no numbers occur more than once (ordinary sudoku rules). So any suggestions on how to start?
Example: Sudoku> candidates example (0,2) [4,8]