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 Ox

Date:04/20/05
Author:Riccardo 'Jack' Lucchetti
URL:n/a
Comments:1
Info:http://www.nuff.ox.ac.uk/Users/Doornik/doc/ox/oxmenu.html
Score: (3.00 in 22 votes)
// 99 Bottles of Beer in Ox
// http://www.nuff.ox.ac.uk/Users/Doornik/doc/ox/oxmenu.html
//
// by Riccardo 'Jack' Lucchetti
// jack@dea.unian.it


#include<oxstd.h>

enum {NOWALL, WALL}

bob(const n, const otw)
{
  decl s="";

  if(n==0)
    s=sprint("No more bottles of beer");
  else
    if(n==1)
      s=sprint(n," bottle of beer");
    else
      s=sprint(n," bottles of beer");

  if(otw)
    s~=" on the wall";

  return(s);
}

main()
{
  decl bottles;
  for(bottles=99; bottles>0; )
    {
      println(bob(bottles,WALL),",");
      println(bob(bottles,NOWALL),",");
      println("Take one down, pass it around;");
      println(bob(--bottles,NOWALL),".\n");
    }

  println("Time to buy more beer!");

}

Download Source | Write Comment

Alternative Versions

Comments

>>  AlisonRoach21 said on 06/10/10 07:34:50

AlisonRoach21 Some time before, I did need to buy a good car for my business but I did not have enough money and couldn't order something. Thank God my brother suggested to get the <a href="http://lowest-rate-loans.com/topics/personal-loans">personal loans</a> at trustworthy bank. Thus, I did that and used to be happy with my college loan.

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: