Language Scheme
(original version)
| Date: | 04/20/05 |
| Author: | Tim Goodwin |
| URL: | n/a |
| Comments: | 2 |
| Info: | n/a |
| Score: |
;;; Tim Goodwin (tim@pipex.net)
(define bottles
(lambda (n)
(cond ((= n 0) (display "No more bottles"))
((= n 1) (display "One bottle"))
(else (display n) (display " bottles")))
(display " of beer")))
(define beer
(lambda (n)
(if (> n 0)
(begin
(bottles n) (display " on the wall") (newline)
(bottles n) (newline)
(display "Take one down, pass it around") (newline)
(bottles (- n 1)) (display " on the wall") (newline)
(newline)
(beer (- n 1))))))
(beer 99)
Download Source | Write Comment
Alternative Versions
| Version | Author | Date | Comments | Rate |
|---|---|---|---|---|
| REALLY using hygienic macros | NMH | 02/02/11 | 0 | |
| slightly shorter, efficient, featureful | Ricardo Malafaia | 08/29/05 | 1 | |
| define-less version | lambda the ultimate | 10/14/10 | 0 | |
| uses the hygenic macro system | Evan Farrer | 08/11/05 | 2 | |
| Cleanly factored MAP-based version | Gnomon | 04/18/08 | 2 |
Download Source | Write Comment
Add Comment
Please provide a value for the fields Name,
Comment and Security Code.
This is a gravatar-friendly website.
E-mail addresses will never be shown.
Enter your e-mail address to use your gravatar.
Please don't post large portions of code here! Use the form to submit new examples or updates instead!
Comments