« Guy Fox AttackFullmetal Alchemist »

Retro Classics: 99 Bottles of Beer


  01:15:33 am, by Nimble   , 321 words  
Categories: Distractions, Programming

Retro Classics: 99 Bottles of Beer

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.");
      writeln(i, " bottle of beer on the wall, ", i, " bottle of beer.");
    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.");
      writeln("No bottles of beer on the wall.");


No feedback yet

An unexpected error has occurred!

If this error persists, please report it to the administrator.

Go back to home page

Additional information about this error:

MySQL error!

Table './nimblebr_b2evolution/evo_hitlog' is marked as crashed and should be repaired(Errno=145)

Your query: Record the hit

INSERT INTO evo_hitlog ( hit_datetime, hit_uri, hit_disp, hit_ctrl, hit_action, hit_type, hit_referer_type, hit_referer, hit_referer_dom_ID, hit_keyphrase_keyp_ID, hit_keyphrase, hit_serprank, hit_coll_ID, hit_remote_addr, hit_agent_type, hit_agent_ID, hit_response_code, hit_sess_ID )
VALUES ( FROM_UNIXTIME( 1679599643 ), '/index.php/retro_classics_99_bottles_of_beer?blog=2', 'single', NULL, NULL, 'standard', 'direct', '', NULL, NULL, NULL, NULL, '2', '', 'unknown', NULL, '200', '11007074' )