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 bc

Date:09/15/05
Author:Feherke
URL:http://rootshell.be/~feherke/
Comments:0
Info:http://www.gnu.org/software/bc/manual/bc.html
Score: (3.00 in 7 votes)
#! /usr/bin/bc -q
/* bc - An arbitrary precision calculator language */

for (i=99;i>=0;) {

  if (i) print i else "No more"
  " bottle"
  if (i-1) "s"
  " of beer on the wall, "
  if (i) print i else "no more"
  " bottle"
  if (i-1) "s"
  print " of beer.\n"

  if (i--) {
    "Take one down and pass it around, "
    if (i) print i else "no more"
    " bottle"
    if (i-1) "s"
    print " of beer on the wall.\n\n"
  } else print "Go to the store and buy some more, 99 bottles of beer on the wall.\n\n"
  
}

halt

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: