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 Lingo

Date:04/20/05
Author:John R. Nyquist
URL:n/a
Comments:0
Info:n/a
Score: (2.96 in 26 votes)
Lingo is Macromedia's Director scripting language.

-- Lingo version of 99 Bottles of Beer 
-- programmer: John R. Nyquist SynapseDes@aol.com


on BottlesOfNABeer
  -- This handler outputs to the message window.
  
  set maxBottles to 99
  
  repeat with bottles = maxBottles down to 1
    set bottleString to WhichString(bottles)
    put bottleString & " of beer on the wall, " & bottleString & " of beer."
    put "Take one down, pass it around," 
    put WhichString(bottles - 1) & " of beer on the wall."
    put RETURN
  end repeat
  
  put "No bottles of beer on the wall, no bottles of beer."
  put "Go to the store and buy some more."
  put maxBottles & " bottles of beer on the wall."
  
end BottlesOfNABeer


on WhichString bottles
  
  if bottles > 1 then
    return bottles & " bottles"
  else if bottles = 1 then
    return "1 bottle"
  else
    return "No more bottles"
  end if
  
end WhichString

Download Source | Write Comment

Alternative Versions

Comments

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: