Language Ox
| Date: | 04/20/05 |
| Author: | Riccardo 'Jack' Lucchetti |
| URL: | n/a |
| Comments: | 0 |
| Info: | http://www.nuff.ox.ac.uk/Users/Doornik/doc/ox/oxmenu.html |
| Score: |
// 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
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