Language AWK
Date: | 04/20/05 |
Author: | Whitey |
URL: | n/a |
Comments: | 4 |
Info: | n/a |
Score: | (3.43 in 35 votes) |
#!/usr/bin/awk -f # awk version of 99 bottles of beer # by Whitey (whitey@netcom.com) - 06/05/95 BEGIN { for(i = 99; i > 0; i--) { print s = bottle(i), "on the wall,", s "," print "take one down, pass it around," print bottle(i - 1), "on the wall." } } function bottle(n) { return sprintf("%s bottle%s of beer", n ? n : "no more", n - 1 ? "s" : "") }
Download Source | Write Comment
Alternative Versions
Version | Author | Date | Comments | Rate |
---|---|---|---|---|
1 | Arnold Robbins | 01/25/08 | 0 | |
correct text | OsamuAoki | 11/03/07 | 2 | |
bottled version | Wilhelm Weske | 11/16/08 | 0 |
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
Vincent Schmid said on 07/19/05 09:51:54
A bit too short : Where is the last part of the song ?
Go to the store and buy some more...
hardus said on 07/19/05 10:03:15
Best one I'v seen
ananomous said on 12/01/06 21:15:35
language sucks.
not really..............................just does'nt make sense
donk0yote said on 12/28/06 15:36:00
GREAT!!! just another fine example of the simplicity and power of AWK.