Tetris checkRow

Log in om je oplossingen te testen.
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)
Je kunt zo vaak indienen als je wenst. Er wordt enkel rekening gehouden met je laatst ingediende oplossing.
Log in om je oplossingen te testen.