Created
July 16, 2009 06:21
-
-
Save KirinDave/148255 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #lang scheme | |
| (letrec ([recur1 | |
| (lambda (x) | |
| (cond | |
| [(< x 0) (display "Countdown complete.")] | |
| [else (printf "Counting ~s~n" x) | |
| (recur2 (- x 1))]))] | |
| [recur2 | |
| (lambda (x) | |
| (cond | |
| [(even? x) (printf "I saw an even number.~n") (recur1 x)] | |
| [(odd? x) (printf "I saw an odd number.~n") (recur1 x)]))]) | |
| (recur2 10)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment