Language PLT Scheme
(language is used to teach beginners (DE)
| Date: | 05/27/09 |
| Author: | Thure Dührsen |
| URL: | n/a |
| Comments: | 2 |
| Info: | http://www.plt-scheme.org/ |
| Score: |
(define (bottles n)
(display
(string-append
(cond ((= n 0) "No more bottles")
((= n 1) "One bottle")
(else (string-append (number->string n) " bottles"))) " of beer")))
(define (beer 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))
)
null
)
)
(beer 99)
Download Source | Write Comment
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
a missing final verse!