feb8pics - import Pictures hiding (white) white, blob, exx,...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: import Pictures hiding (white) white, blob, exx, black:: Picture white = [".....", ".....", ".....", ".....", "....."] blob = ["..#..", ".###.", ".###.", ".###.", "..#.."] exx = ["#...#", ".#.#.", "..#..", ".#.#.", "#...#"] black = invertColour white------------------------------------------------------------------------------ -- column n pic ---- returns a picture corresponding to a column of n copies of pic ---- An error arises if n is less than 1------------------------------------------------------------------------------ column :: Int -> Picture -> Picture column n pic | n == 1 = pic | n > 1 = above pic (column (n-1) pic) | otherwise = error "column: input was less than 1"------------------------------------------------------------------------------ -- row n pic ---- returns a picture corresponding to a row of n copies of pic ---- An error arises if n is less than 1------------------------------------------------------------------------------ row :: Int -> Picture -> Picture row n pic | n == 1 = pic | n > 1 = sideBySide pic (row (n-1) pic) | otherwise = error "row: input was less than 1"------------------------------------------------------------------------------ -- altRow n pic ---- returns the picture of a row of n copies of pic; however,-- each occurrence of pic has its color inverted from the previous -- occurrence, resulting in an *alternating* row of pictures.occurrence, resulting in an *alternating* row of pictures....
View Full Document

Page1 / 5

feb8pics - import Pictures hiding (white) white, blob, exx,...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online