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?"

59 of 93 comments (clear)

  1. I hate these competitions. by lukew · · Score: 3, Funny

    .. mainly due to the fact I can never come up with anything good. :-(

    FP?

  2. blech. by transiit · · Score: 4, Funny

    The closest I've ever come to this (or plan to) was a quick and dirty perl script which generated all of the words to "4294967295 Bottles of Beer on the Wall", which was piped to festival.

    My roommates, while amused for the first 10 minutes or so, threatened grevious personal injury a few hours later.

    -transiit

  3. What's the point... by Webz · · Score: 5, Informative

    ...so long as this exists? It's pretty well stocked with languages. Why did someone even come up with this contest?

    1. Re:What's the point... by JDWTopGuy · · Score: 2

      The entries are judged on compactness, obfuscation, and originality.

      For example, my entry was short and obfuscated. (Those two have (according to the page) a "weigh factor of 2".) Granted, the obfuscation was kinda lame, but (not counting the REBOL headers) it was only one (> 300 char) line. (And no, I didn't just remove the newlines. You'll see.)

      --
      Ron Paul 2012
    2. Re:What's the point... by n1ywb · · Score: 1

      My entry is only 248 bytes and whoops the shit out of the beerlyrics program written in the same language on that other site.

      --
      -73, de n1ywb
      www.n1ywb.com
    3. Re:What's the point... by JDWTopGuy · · Score: 1

      I'm curious, what language was it? I'll admit my entry was just plain programming. I didn't really use any tricky stuff.

      That said, it's a tiny program and ran quickly. Maybe I could try writing one in python, the site did say you could enter 3 times.

      --
      Ron Paul 2012
    4. Re:What's the point... by n1ywb · · Score: 1

      You'll find out in May ;) Honestly though, I'm a little worried after seeing that one written in K. 240 bytes may not be much but that K one is still about half a long and definately a lot worse to look at.

      --
      -73, de n1ywb
      www.n1ywb.com
  4. My version by Anonymous Coward · · Score: 3, Funny

    if [ `uname` = "FreeBSD" ]; then
    echo you\'ll be dead before this song is over;
    fi

  5. My program by MobyDisk · · Score: 4, Funny

    lynx -dump http://www.noodleroni.com/beerlyrics.txt

    Undoubtedly, the first 5 million entries will be along these lines. So I fully expect Mr McLean to disable internet access, and/or modify the page at http://www.noodleroni.com/beerlyrics.txt to say "SUCKER!" or something like that. :-)

    1. Re:My program by y0bhgu0d · · Score: 1

      hey! you stole my idea! >:O

      haha.

    2. Re:My program by Directrix1 · · Score: 1

      Just use the google cache :-P. And change what you posted above to a bash script.

      --
      Occam's razor is the blind faith in the natural selection of least resistance and in universal oversimplification. -- EF
    3. Re:My program by n1ywb · · Score: 1

      I don't think that really earns any points for obfuscation or originality, so you get a 40 out of 100.

      --
      -73, de n1ywb
      www.n1ywb.com
    4. Re:My program by n1ywb · · Score: 1

      #!/bin/sh
      wget --http://www.noodleroni.com/beerlyrics.txt ; cat beerlyrics.txt

      All we have to do to disqualify obvious entries is post them here.

      --
      -73, de n1ywb
      www.n1ywb.com
  6. Malbolge is truly evil by Scarblac · · Score: 4, Informative

    A solution in Malbolge would be really really amazing. No-one has shown that it is possible to do loops in Malbolge yet; and a program with that much output would be really hard to make.

    Someone did finally come up with a "Hello World" in Malbolge! Well, almost. He managed to make a "HEllO WORld" program by writing a genetic algorithm that took a few hours to find the program.

    This is the source code:

    (=<`$9]7<5YXz7wT.3,+O/o'K%$H"'~D|#z@b=`{^Lx8%$Xmrk pohm-kNi;gsedcba`_^]\[ZYXWVUTSRQPONMLKJIHGFEDCBA@? >=<;:9876543s+O<oLm

    See http://www.acooke.org/andrew/writing/malbolge.html .

    --
    I believe posters are recognized by their sig. So I made one.
    1. Re:Malbolge is truly evil by fredrikj · · Score: 3, Informative

      What's this then?

    2. Re:Malbolge is truly evil by orangesquid · · Score: 1

      How was this done?!?! I am truly stumped....
      Advanced translation system? That's my best guess. I doubt a human could code in Malbolge in a reasonable amount of time...

      --
      --TheOrangeSquid Is it any wonder things seem so awry? We swim in a sea of confusion and don't have to think to survive
    3. Re:Malbolge is truly evil by JDWTopGuy · · Score: 1

      That is pure evil. I could never enter one of these because I mainly progam in REBOL which is much too simple.

      for bottles 99 1 -1 [
      print rejoin [ bottles " of beer on the wall..." ]
      ]

      You get the idea.

      --
      Ron Paul 2012
    4. Re:Malbolge is truly evil by JDWTopGuy · · Score: 1

      Murphy's law, after posting that I wrote & submitted an entry in REBOL. Obviously, I can't describe it here because of contest rules, but it was pretty good.

      Good luck to all those who enter.

      --
      Ron Paul 2012
    5. Re:Malbolge is truly evil by Lord+Sauron · · Score: 1

      Here's a better explanation of Malbolge

    6. Re:Malbolge is truly evil by Lord+Sauron · · Score: 1

      I was wondering... Is Malbolge object-oriented ?

    7. Re:Malbolge is truly evil by orangesquid · · Score: 1

      Ah, believe me, I've read through that document many times :) but I've never been able to create a non-trivial program... I'm just wondering how the proper Hello World one was done?

      --
      --TheOrangeSquid Is it any wonder things seem so awry? We swim in a sea of confusion and don't have to think to survive
    8. Re:Malbolge is truly evil by JDWTopGuy · · Score: 1

      No, but if you try to use it you will become object-oriented. Specifically, you will become oriented towards throwing and smashing objects, including your head.

      It needs a surgeon general's warning.

      --
      Ron Paul 2012
    9. Re:Malbolge is truly evil by ASCIIMan · · Score: 2, Interesting
      He's an even better one:

      89-character Malbolge "Hello World"

  7. Some good suggestios... by Directrix1 · · Score: 4, Funny
    Here are a few suggestions for ya:

    Write an obfuscated proggie that roots the system, searches for the file beerlyrics.txt and if it finds it pipes it to stdout (followed by /etc/passwd), and then proceeds to spread over the network following the same actions on each machine

    Write a program that calls 911 on the modem, and then drunkenly sings the 99 bottles of beer song to the 911 operator by using 56khz 1-bit audio :-P (calling internationally works also ;-) )

    Write a karaoke 99 bottles sing-along proggie, which records his vocal patterns and then calls the whitehouses and uses his prerecorded phonetics to generate a terrorist threat towards the president in his voice!

    I'm sure you can come up with more than this, but these sure seem to be winners to me.

    --
    Occam's razor is the blind faith in the natural selection of least resistance and in universal oversimplification. -- EF
  8. Mmmm.... alcohol poisoning.... by Dr.+Photo · · Score: 4, Funny

    I'd like to see an entry that progressively prints out drunker and drunker approximations of what the actual lyrics should be, then after about 20 beers it dumps core and passes out... ;-)

    1. Re:Mmmm.... alcohol poisoning.... by JDWTopGuy · · Score: 1

      1 botttlesh of beeer on daa wallll,
      won bottle of beeeeeerrr,
      drink er down, passhh it aroun
      hey, wheresh all da beer?
      gotta go get shome more... *hic*

      2 policemen in a squad car,
      2 policemen,
      One gets out and makes an arrest,
      1 policeman left in the car.

      99 drunks in jail,
      99 drunks in jail,
      Add one more and whadya got,
      100 drunks in jail.

      In case you're wondering, I'm making this public domain.

      --
      Ron Paul 2012
    2. Re:Mmmm.... alcohol poisoning.... by larry+bagina · · Score: 1
      In case you're wondering, I'm making this public domain.

      I was hoping you'd release it as free (beer).

      --
      Do you even lift?

      These aren't the 'roids you're looking for.

  9. Here it is in COW. by BigZaphod · · Score: 1

    A friend of mine wrote 99 bottles of beer in my COW language. It is an interesting sight to behold.

    1. Re:Here it is in COW. by Danta · · Score: 1

      Nice, but I think this one in written ZT is somehow neater.

    2. Re:Here it is in COW. by NamShubCMX · · Score: 1
      --
      We've always been at war with Eurasia.
  10. 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.
    1. Re:In K by n1ywb · · Score: 1

      Fuck there's the winning entry :( Oh wait, you posted it on /. so you're disqualified. YES, now I have a chance! :)

      --
      -73, de n1ywb
      www.n1ywb.com
    2. Re:In K by c_oflynn · · Score: 1

      Why post real text? Just hope they have an ASCII system and use the ASCII equivilent of all the text (ie: take one down.. etc) to be even less legible..

  11. Been there done that? by Smidge204 · · Score: 3, Informative

    Gee, hope none of the contestants find this place, even though it's the first hit on Google...

    =Smidge=

    1. Re:Been there done that? by -douggy · · Score: 1

      The Fromage one is awesome HOW >>>>>?

  12. Spell out the quantity... by runswithd6s · · Score: 1
    It'd make it far more challenging.
    Ninetynine bottles of beer on the wall,
    ninetynine bottles of beer...
    --
    assert(expired(knowledge)); /* core dump */
  13. Fuck me running.... sendmail? by devphil · · Score: 2, Funny


    Indeed. Any "99 bottles" programming list complete enough to include the infamous sendmail version is more than enough. No contest need be held.

    Besides, "99 bottles" is boring. Use the programmer's version:

    99 little bugs in the code,
    99 little bu-u-u-ugs,
    fix a bug,
    compile again,
    100 little bugs in the code.

    (Subsequent verses increase the number of bugs by powers of two, i.e., 99, 100, 102, 106, 114, 130, 162, 226, ...)

    --
    You cannot apply a technological solution to a sociological problem. (Edwards' Law)
    1. Re:Fuck me running.... sendmail? by cliveholloway · · Score: 1
      And I thought the Apache SSI one was bad!


      cLive ;-)

      --
      -- Trinity in high heels carrying a whip: The donimatrix - there is no spoonerism
  14. My 3 line python entry by smoondog · · Score: 1

    import urllib, sys
    f = urllib.urlopen("http://www.noodleroni.com/beerlyri cs.txt")
    sys.stdout.write(f.read())
    #heh, heh, heh

    -Sean

  15. 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
  16. Nope, nope, I'm sorry... by dmorin · · Score: 2, Funny
    I do *not* write "proggies". Nor do I give out my email "addy".

    I am a grown adult, you see. I am capable of speaking in complete words.

    Duane

    "The kids today used to say stuff like hizzook when they meant hook, like "off the hizzook". Now they just say 'hizzle'. It's as if, having added a syllable to the word, they're now too ignorant and lazy to bother finishing the damned thing."

    1. Re:Nope, nope, I'm sorry... by JDWTopGuy · · Score: 1

      Dis post iz off da hizzook! Wassup wit dat?

      477 y0ur b4s3 4r3 b3l0ng t0 h4x0rs. U R 0wn3d.

      7h3r3 g035 /\/\y k4rm4.

      --
      Ron Paul 2012
  17. Smaller by Jayson · · Score: 1

    It takes much less space use strings instead of interger lists, and that is one of the judging criterion. I think I might be able to pack the string tighter, though (then it would just look like garbage).

  18. My perl version by andy@petdance.com · · Score: 1
    LWP makes everything so easy. If you don't have Sean Burke's excllent LWP & Perl , do so:
    perl -MLWP::Simple -e'print get "http://www.noodleroni.com/beerlyrics.txt"'

    Or, using my WWW::Mechanize module,

    #!/usr/bin/perl -w

    use WWW::Mechanize;

    my $agent = new WWW::Mechanize();
    $agent->get( 'http://www.noodleroni.com/beerlyrics.txt' );
    print $agent->content;
  19. ...make that 488 languages by NaDrew · · Score: 1

    Too bad that page doesn't seem to have been updated since last year sometime. I just sent him a version in InstallScript (InstallShield's scripting language). I'd enter in this contest but InstallShield isn't available on Linux.

    /*
    99 Bottles of Beer in InstallScript
    (c) 2003 Project Insomnia
    Released under GPL for http://99-bottles-of-beer.ls-la.net/
    Requires: InstallShield Professional 5 or greater
    */

    #include "ifx.h"

    NUMBER nBottles;
    STRING szTitle, szStatus, szTitleS, szStatusS;

    program

    Disable ( BACKGROUND );
    Enable ( STATUSDLG );

    for nBottles = 99 downto 0
    switch ( nBottles )
    case 1:
    szTitleS = "";
    szStatusS = "s";
    default:
    szTitleS = "s";
    switch ( nBottles )
    case 2:
    szStatusS = "";
    default:
    szStatusS = "s";
    endswitch;
    endswitch;
    Sprintf ( szTitle, "%d bottle%s of beer on the wall, %d bottle%s of beer",
    nBottles, szTitleS, nBottles, szTitleS );
    if ( nBottles ) then
    Sprintf ( szStatus, "Take one down, pass it around, %d bottle%s of beer on the wall.",
    nBottles - 1, szStatusS );
    else
    szStatus = "";
    endif;
    SetDialogTitle ( DLG_STATUS, szTitle );
    SetStatusWindow ( nBottles, szStatus );
    Delay ( 1 );
    endfor;

    Disable ( STATUSDLG );

    endprogram

    --
    Vista:XPSP2::ME:98SE
  20. php by NamShubCMX · · Score: 1
    Well, took me 3 minutes, 8 ";"

    99 botles on the wall...

    Any idea how to reduce it?

    <?php
    function s($x){return($x==1?"":"s");}
    $a=99;$b=" bottle";$o=" of beer";$w=" on the wall";
    $r="\n<br>";$p= "Take one down, pass it around,$r";
    while($a>0){print("$a$b".s($a)."$o$w, $r$a$b".s($a)."$o,$r$p".(--$a==0?"No more ":$a).$b.s($a)."$o$w.$r$r"); }
    ?>
    --
    We've always been at war with Eurasia.
    1. Re:php by aberson · · Score: 1

      two stupid ways:
      - change

    2. Re:php by aberson · · Score: 1

      ok, apparantly "plain text" doesn't actually mean plain text. let's try again:

      - change <?php to just <?
      - get rid of the <br>

  21. Re:shortest c program? by themadmoney · · Score: 1

    You should really stop posting your programs, despite how much you want the slashdot fame. any number of idiots can now copy and submit that, and anyway, the rules explicitly forbid posting it publically until may 1st

    by the way, i got my java program down to 589 bytes

  22. Progg? by Tsali · · Score: 1

    I thought it said, "perogies"... 99 Bottles in Polish? It had to have been done before.

    --
    This space for rent.
  23. You mean, like... by alispguru · · Score: 1

    this?

    It helps to use a language that has number-to-english-cardinal built into it (hint: it's the ~R entries in the format string).

    --

    To a Lisp hacker, XML is S-expressions in drag.
  24. You have absolutely got to try... by UtilityFog · · Score: 1

    ... the Expect version (by Don Libes, the creator of Expect). It's the only program that has made me laugh out loud when I ran it.

  25. Re:Mmmm.... alcohol poisoning....done with expect by mvdw · · Score: 1

    This is similar to the X screensaver that continuously types out, complete with random typos, "All work and no play makes Jack a dull boy"

  26. I messed up, down another 15 bytes to 224 by buffer-overflowed · · Score: 1

    main(){int n=99,l;while(n)for(l=0;l4;(l==2?l++,n--:l++)){prin tf(l==2?"Take one
    down, pass it around,\n":"%d%s bottle%s of beer%s%c\n%s",n,(!n?"\bNo more":""),"s"+(n==1),l==1?"":" on the wall",",."[l==3],"\n"+(l!=3||!n));}}

    --
    The key to the enjoyment of pop music is to replace any instance of "love" with "C.H.U.D."
  27. Re:Mmmm.... alcohol poisoning....done with expect by Tarpan · · Score: 1

    Let me make a wild guess, you've not seen The shining?

  28. My attempt (Pseudocode) by Sam+Nitzberg · · Score: 1

    Done =0 ; Drink until no bottles left

    Function Drink (Bottles):
    Print_or_verbalize (Bottles); //generic output - print or speak number of bottles remaining
    if (Bottles !=Done)
    Drink (Bottles-1) // Recurse with one less bottle
    exit

    Program:
    Bottles := 1E02 - 1 // cheap excuse for scientific notation
    Drink (Bottles)
    Done

  29. Re:Mmmm.... alcohol poisoning....done with expect by mvdw · · Score: 1
    Let me make a wild guess, you've not seen The shining [imdb.com]?

    No, but I did know that the screensaver was from a movie, I just neglected to mention it :-).

  30. Re:Mmmm.... alcohol poisoning....done with expect by Tarpan · · Score: 1

    Ahh.. well you should see the movie, it's great :)

  31. heh by ApochPiQ · · Score: 1

    671 bytes in NASM...