FP Laboratory 6
Jump to navigation
Jump to search
List of lists
Consider following type representing picture:
type Pic = [String]
If you want to print this picture you can use:
pp :: Pic -> IO ()
pp x = putStr (concat (map (++"\n") x))
Picture example:
pic :: Pic
pic = [ "....#....",
"...###...",
"..#.#.#..",
".#..#..#.",
"....#....",
"....#....",
"....#####"]
Create functions that:
- Flips picture veriticaly and horizontaly.
flipV :: Pic -> Pic
flipV :: Pic -> Pic
- Place one picture above another.
above :: Pic -> Pic -> Pic
- Place two pictures side by side (consider, that they have the same height).
sideBySide :: Pic -> Pic -> Pic
- Rotate picture to the left and to the right.
rotateR :: Pic -> Pic
rotateL :: Pic -> Pic
- Increase every point in the picture n times.
zoom :: Int -> Pic -> Pic