/* And then Little Cat A
* Took the hat off HIS head.
* "It is good I have some one
* To help ME," he said.
* "This is Little Cat B.
* And I keep him about,
* And when I need help
* Then I let him come out."
* And then B said,
* "I think we need Little Cat C."
* -- "The Cat in the Hat Comes Back" Dr. Seuss
*/
void little_cat(
(
Read more... )
Comments 2
Ooh, I want to play, too!
(define (little-cat letter)
(if (eq? letter #\Z)
"voom"
(little-cat (integer->char (+ (char->integer letter) 1)))))
(I think the Cat in the Hat books were brilliant. The original book used only 236 unique words! And it's still a joy to read.)
Reply
littleCat 'Z' = "voom"
littleCat letter = littleCat $ succ letter
However it's implemented though, I could definitely see myself throwing such a code snippet (with the quotation from the book in a comment of course!) on a CS 151 type exam and asking what it's an example of and what each branch of the if-statement represents. Who says example code always has to be boring?
Reply
Leave a comment