Language Apple Script
|Score:||(3.02 in 135 votes)|
-- AppleScript version of "99 Bottles of Beer" -- by Kristopher Johnson firstname.lastname@example.org to createBottleString for aNumberOfBottles if aNumberOfBottles is 0 then return "No more bottles" else if aNumberOfBottles is 1 then return "1 more bottle" else return (aNumberOfBottles as string) & " bottles" end if end createBottleString set lyrics to "" repeat with numberOfBottles from 99 to 1 by -1 set bottleString to (createBottleString for numberOfBottles) set lyrics to lyrics & bottleString & " of beer on the wall, " & bottleString & " of beer. " & return set lyrics to lyrics & "Take one down and pass it around, " & return set lyrics to lyrics & (createBottleString for (numberOfBottles - 1)) & " of beer on the wall. " & return end repeat set lyrics to lyrics & "No more bottles of beer on the wall, no more bottles of beer." & return set lyrics to lyrics & "Go to the store and buy some more." & return set lyrics to lyrics & "99 bottles of beer on the wall." return lyrics
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!