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.03 in 391 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
Version | Author | Date | Comments | Rate |
---|---|---|---|---|
Fully commented, OOP approach. | Ariel Flesler | 03/28/08 | 0 | |
using DOM and a closure | Christof Donat | 03/07/06 | 0 | |
3 | Brian Patrick Lee | 04/20/05 | 3 | |
With english numbers, DOM, and callbacks | Joseph Taylor | 01/18/08 | 0 |
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!
Comments
Goura said on 05/04/09 22:27:05
very "concise" one
Fabian said on 03/03/10 17:25:47
Genial!
l4nig3r said on 07/10/10 15:58:07
Very cool ^^
Edo said on 08/06/10 18:55:31
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!