99 Bottles of Beer on the Wall

A bit of fun.

Take a look at the website http://www.99-bottles-of-beer.net

This Website holds a collection of the “Song 99 Bottles of Beer” programmed in different programming languages.

Here is my DXL version of that song.


// 99 Bottles of Beer

/*
DXL - DOORS Extension Language

Tony Goodman		www.smartdxl.com
*/

int NUM_BOTTLES = 9

void verse(int bottles)
{
print bottles " bottle" (bottles == 1 ? "" : "s") " of beer on the wall, "
print bottles " bottle" (bottles == 1 ? "" : "s") " of beer.\n"
print "Take one down and pass it around, "
print ((bottles - 1) == 0 ? "no more" : (bottles - 1) "") " bottle" (bottles-1 == 1 ? "" : "s")
print " of beer on the wall\n\n"
}

int bottles = 0

for (bottles = NUM_BOTTLES; bottles > 0; bottles--)
{
verse(bottles)
}

print "No more bottle of beer on the wall, no more bottles of beer.\n"
print "Go to the store and buy some more, " NUM_BOTTLES " bottles of beer on the wall.\n"