module Sudoku where import Test.QuickCheck ------------------------------------------------------------------------- data Sudoku = Sudoku { rows :: [[Maybe Int]] } deriving ( Show, Eq ) -- allBlankSudoku is a sudoku with just blanks allBlankSudoku :: Sudoku allBlankSudoku = undefined -- isSudoku sud checks if sud is really a valid representation of a sudoku -- puzzle isSudoku :: Sudoku -> Bool isSudoku = undefined -- isSolved sud checks if sud is already solved, i.e. there are no blanks isSolved :: Sudoku -> Bool isSolved = undefined ------------------------------------------------------------------------- -- printSudoku sud prints a representation of the sudoku sud on the screen printSudoku :: Sudoku -> IO () printSudoku = undefined -- readSudoku file reads from the file, and either delivers it, or stops -- if the file did not contain a sudoku readSudoku :: FilePath -> IO Sudoku readSudoku = undefined ------------------------------------------------------------------------- -- cell generates an arbitrary cell in a Sudoku cell :: Gen (Maybe Int) cell = undefined -- an instance for generating Arbitrary Sudokus instance Arbitrary Sudoku where arbitrary = do rows <- vectorOf 9 (vectorOf 9 cell) return (Sudoku rows) -------------------------------------------------------------------------