Tetris checkRow

Sign in to test your solution.
import Data.List data Block = Block (Int,Int) deriving (Eq,Show) data Board = Board [Block] deriving (Eq,Show) onRow :: Int -> Block -> Bool onRow y (Block (_,y2)) = y == y2 lower :: Int -> Block -> Block lower y (Block (x,y2)) | y > y2 = Block (x,y2+1) | otherwise = Block (x,y2) -- Check whether the board has full lines -- If we are at line 0 just return the board -- If the board has a full line lower all the blocks above -- otherwise check that the line below is full -- (* Difficulty 2 *) checkRow :: Int -> Board -> Board checkRow 0 (Board b) = (Board b) checkRow y (Board b) | length rowY == 10 = undefined | otherwise = undefined where rowY = (filter (onRow y) b)
You can submit as many times as you like. Only your latest submission will be taken into account.
Sign in to test your solution.