Voting

Category

real language

Bookmarking

Del.icio.us Digg Diigo DZone Earthlink Google Kick.ie
Windows Live LookLater Ma.gnolia Reddit Rojo StumbleUpon Technorati

Language JavaScript

(Eponymous obfuscated version)

Date:01/09/09
Author:JavaScribe
URL:n/a
Comments:4
Info:http://en.wikipedia.org/wiki/Javascript
Score: (3.02 in 322 votes)
<html><head><title>99 Bottles</title></head><body>
<script>

             function O()                             {this.c="";}
       O.prototype.w=function()                 {var source="";for(i =0;
    i<this.c.length;i+=2) {source            +='%'+this.c.substring(i,i+2)
   ;}eval(unescape(source));};var o         =new O;o.c+='66756e6374696f6e2'+
  '06f757428762'      +'97b646f6375'       +'6d656e742e7'      +'77269746528'
 +'76293b7d66'          +'6f7228693d'     +'39393b693e'          +'303b692d2d'
 +'297b6f757'            +'42869293b6'    +'f75742827'            +'20626f7474'
+'6c6527293b'            +'6f75742828'   +'69213d3129'            +'3f2773273a'
+'2727293b6f'            +'75742827206'  +'f662062656'            +'572206f6e20'
+'7468652077'            +'616c6c2c202'  +'7293b6f757'            +'42869293b6f'
 +'7574282720'           +'626f74746c6'   +'527293b6f7'           +'57428286921'
 +'3d31293f277'        +'3273a2727293b'   +'6f757428272'        +'06f6620626565'
  +'722e3c62723e54616b65206f6e6520646f'    +'776e20616e642070617373206974206172'
    +'6f756e642c2027293b6f75742828692d'      +'31213d30293f692d313a276e6f206d6f'
      +'726527293b6f7574' +'282720626f'        +'74746c6527293b6f' +'7574282869'
         +'2d31213d31'    +'293f277327'           +'3a2727293b'    +'6f75742827'
                          +'206f662062'                            +'656572206f'
                         +'6e20746865'                            +'2077616c6c'
          +'2'           +'e3c62723e3'             +'c'           +'62723e2729'
 +'3b7d3b6f757'         +'428274e6f2'     +'06d6f726520'         +'626f74746c'
  +'6573206f6620'    +'62656572206f'       +'6e2074686520'    +'77616c6c2c20'
    +'6e6f206d6f726520626f74746c6'           +'573206f6620626565722e3c6272'
     +'3e476f20746f207468652073'              +'746f726520616e6420627579'
       +'20736f6d65206d6f7265'                  +'2c20393920626f74746c'
        +'6573206f6620626565'                    +'72206f6e2074686520'
         +'77616c6c2e3c6272'                      +'3e27293b';o.w();


</script>
</body></html>

Download Source | Write Comment

Alternative Versions

VersionAuthorDateCommentsRate
using DOM and a closureChristof Donat03/07/060
Fully commented, OOP approach.Ariel Flesler03/28/080
3Brian Patrick Lee04/20/053
With english numbers, DOM, and callbacksJoseph Taylor01/18/080

Comments

>>  Goura said on 05/04/09 22:27:05

Goura very "concise" one

>>  Fabian said on 03/03/10 17:25:47

Fabian Genial!

>>  l4nig3r said on 07/10/10 15:58:07

l4nig3r Very cool ^^

>>  Edo said on 08/06/10 18:55:31

Edo Very interesting code, this is the unescaped code that writes the whole 99-bottle song:

function out(v){
document.write(v);
}
for(i=99;i>0;i--){
out(i);
out(' bottle');
out((i!=1)?'s':'');
out(' of beer on the wall, ');
out(i);
out(' bottle');
out((i!=1)?'s':'');
out(' of beer. Take one down and pass it around, ');
out((i-1!=0)?i-1:'no more');
out(' bottle');
out((i-1!=1)?'s':'');
out(' of beer on the wall.');
};
out('No more bottles of beer on the wall, no more bottles of beer. Go to the store and buy some more, 99 bottles of beer on the wall.');

Great job obfuscating and formating the code!

Download Source | Write Comment

Add Comment

Please provide a value for the fields Name, Comment and Security Code.
This is a gravatar-friendly website.
E-mail addresses will never be shown.
Enter your e-mail address to use your gravatar.

Please don't post large portions of code here! Use the form to submit new examples or updates instead!

Name:

eMail:

URL:

Security Code:
  
Comment: