« Guy Fox Attack | Fullmetal Alchemist » |
Link: http://www.99-bottles-of-beer.net/
Sometimes, there are sites that bring back waves of memory to crusty nerds such as myself. There is a site, which I believe has been around for quite some time, giving code examples of how to count down "99 bottles of beer on the wall, 99 bottles of beer, take one down, pass it around, 98 bottles of beer on the wall..." etc.
This is a relatively simple exercise, but different computer languages handle it somewhat differently, and even the same language can technically handle it multiple ways.
What makes http://www.99-bottles-of-beer.net/ different is that they have such a wide variety of programming languages used as samples.
I didn't think Draco would be on the list, but it is. Its claim to fame for me was appearing on one of the free Fred Fish disks, and having one of the provided sample programs make falling snow (piling up in letters like U) in your active window.
Here's the source in Draco:
/* 99 Bottles of Beer */
/* James Hicks (hicksjl@cs.rose-hulman.edu) */
/* 5 August 1996 */
int BEERS = 99;
proc main()void:
uint i;
for i from BEERS downto 1 do
if i > 1 then
writeln(i, " bottles of beer on the wall, ", i, " bottles of beer.");
else
writeln(i, " bottle of beer on the wall, ", i, " bottle of beer.");
fi;
writeln("Take one down, pass it around,");
if i > 2 then
writeln(i - 1, " bottles of beer on the wall.");
elsif i > 1 then
writeln(i - 1, " bottle of beer on the wall.");
else
writeln("No bottles of beer on the wall.");
fi;
od;
corp;