Slashdot Mirror


$BottlesOfBeerOnTheWall = 99;

Noodleroni writes "The First Maybe-Annual 99-Bottles-of-Beer-on-the-Wall-Proggie Contest is now under way! We are looking for your most compact, obfuscated, or other wise cool code to print out the entire lyrics of the aforementioned, very long, song. Maybe we'll even get some submissions written in Malbolge?"

3 of 93 comments (clear)

  1. In K by Jayson · · Score: 3, Interesting
    w:" on the wall";v:r,w,",\n",r,",\nTake one down, pass it around,\n",("L",1_ r:"N bottles of beer"),w,".\n\n";`0:_ssr/[,/_ssr/[v;"NL"]'+($1+s;$ s:|!98);(b,"s";`"0");(b:"1 bottle";"No more")]


    I'm sure I can cut at least ten characters off of that. I doubt it will be anywhere close to the smallest, though.
  2. Re:Mmmm.... alcohol poisoning....done with expect by viking_kiwi · · Score: 2, Interesting
    This has been done using expect,a language mainly used for talking to interactive programs. It has a feature that it can pretend to be a human (and thus have an irregular and slow typing speed). This is used for the beer program, which comes as a demo with expect. (If you have Tcl installed you probably have it)

    The final verse in one run

    11 botqle off baer oc tbe wakl,
    1 botplo of beer,
    take onne da, pass itt arounm,
    0 yotglees oof beeeer on tte walll.


    beer.exp:

    # 99 bottles of beer on the wall, Expect-style
    # Author: Don Libes

    Unlike programs (http://www.ionet.net/~timtroyr/funhouse/beer.html )
    which merely print out the 99 verses, this one SIMULATES a human
    typing the beer song. Like a real human, typing mistakes and timing
    becomes more erratic with each beer - the final verse is barely
    recognizable and it is really like watching a typist hunt and peck
    while drunk.

    Finally, no humans actually sing all 99 verses - particularly when
    drunk. In reality, they occasionally lose their place (or just get
    bored) and skip verses, so this program does likewise.

    Because the output is timed, just looking at the output isn't enough
    - you really have to see the program running to appreciate it.
    Nonetheless, for convenience, output from one run (it's different
    every time of course) can be found in the file beer.exp.out
    But it won't show the erratic timing; you have to run it for that.

    # For an even fancier version, see http://expect.nist.gov/scripts/superbeer.exp
  3. Re:Malbolge is truly evil by ASCIIMan · · Score: 2, Interesting
    He's an even better one:

    89-character Malbolge "Hello World"