Language GNU bc
(uses GNU extensions of bc)
| Date: | 06/12/05 |
| Author: | Laurent Le Brun |
| URL: | n/a |
| Comments: | 0 |
| Info: | http://www.gnu.org/software/bc/bc.html |
| Score: |
/* Author: Laurent Le Brun <llb [at] fr.fm>
/* few improvements by Michaël Cadilhac <cadilhac-@t-lrde.epita.fr>
/* GNU bc version of 99 bottles of beer
*/
i = 100
while (i--) {
print i, " bottle"; if (i != 1) "s"; print " of beer on the wall, "
print i, " bottle"; if (i != 1) "s"; print " of beer.\n"
print "Take one down, pass it around. "
if (i == 1) break
print i - 1; " bottle"; if (i != 2) "s"; print " of beer on the wall.\n\n"
}
print "no more bottles of beer on the wall.\n\n"
print "No more bottle of beer on the wall. No more bottles of beer...\n"
print "Go to the store and buy some more...99 bottles of beer.\n\n"
quit
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