CS 119 Lab 2 – Recursion
Objectives
Perform the following tasks in the order given.
> downUp (word "a")
[a]
| Assignment: Fix the error in downUp. |
> explode (word "dynamite")
[d y n a m i t e ]
The function takes a word as its argument and returns a sentence containing
the single letters of this word.
|
Assignment: Write both linear recursive and tail recursive versions of the function explode. |
|
Assignment: Define a function stackCopies :: Int -> Image -> Image such that stackCopies n q will produce a stack of n copies of quilt q |
|
Assignment: Define a function quilt :: Int -> Int -> Image -> Image in which quilt w h q will produce a quilt of width w and height h composed of multiple copies of quilt q. |