Voting

Category

real language

Bookmarking

Del.icio.us Digg Diigo DZone Earthlink Google Kick.ie
Windows Live LookLater Ma.gnolia Reddit Rojo StumbleUpon Technorati

Language Festival

Date:04/20/05
Author:Anonymous
URL:n/a
Comments:1
Info:n/a
Score: (2.89 in 94 votes)
; 99 Bottles of beer said by the festival speech synthesis program

(define bottles
  (lambda (n)
      (cond ((eq n 0) (SayText "No more bottles"))
            ((eq n 1) (SayText "One bottle"))
            ((> n 1) (SayText n) (SayText " bottles")))
      (SayText " of beer")))

(define beer
  (lambda (n)
    (if (> n 0)
        (begin
          (bottles n) (SayText " on the wall")
          (bottles n)
          (SayText "Take one down, pass it around ")
          (bottles (- n 1)) (SayText " on the wall")
          (beer (- n 1))))))

(beer 99)

Download Source | Write Comment

Alternative Versions

Comments

>>  Eric Moritz said on 01/20/06 17:20:35

Eric Moritz This would drive me nuts if I ran this all the way through.

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!

Name:

eMail:

URL:

Security Code:
  
Comment: