Skip to content

Instantly share code, notes, and snippets.

@aemkei
Forked from 140bytes/LICENSE.txt
Last active March 7, 2025 20:08
Show Gist options
  • Select an option

  • Save aemkei/1672254 to your computer and use it in GitHub Desktop.

Select an option

Save aemkei/1672254 to your computer and use it in GitHub Desktop.

Revisions

  1. aemkei revised this gist Feb 15, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@ A simplified variant of the classic tetris game done in less than 140 bytes of J

    [**Click here to play the DEMO**](http://jsbin.com/egiqul/195)!

    NEW: A standalone version in 310 bytes: [aem1k.com/tetris](http://aem1k.com/tetris/)
    NEW: A standalone version in 300 bytes: [aem1k.com/tetris](http://aem1k.com/tetris/)

    ### Source

  2. aemkei revised this gist Apr 11, 2015. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -4,6 +4,8 @@ A simplified variant of the classic tetris game done in less than 140 bytes of J

    [**Click here to play the DEMO**](http://jsbin.com/egiqul/195)!

    NEW: A standalone version in 310 bytes: [aem1k.com/tetris](http://aem1k.com/tetris/)

    ### Source

    ```javascript
  3. aemkei revised this gist Jun 3, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # Binary Tetris - 140byt.es

    A simplified variant of the classic tetris game done in less that 140 bytes of JavaScript.
    A simplified variant of the classic tetris game done in less than 140 bytes of JavaScript.

    [**Click here to play the DEMO**](http://jsbin.com/egiqul/195)!

  4. aemkei revised this gist Dec 8, 2012. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@

    A simplified variant of the classic tetris game done in less that 140 bytes of JavaScript.

    [**Click here to play the DEMO**](http://jsbin.com/egiqul/49)!
    [**Click here to play the DEMO**](http://jsbin.com/egiqul/195)!

    ### Source

    @@ -90,4 +90,4 @@ See the [140byt.es](http://140byt.es) site for a showcase of entries (built itse

    To learn about byte-saving hacks for your own code, or to contribute what you've learned, head to [the wiki](https://github.com/jed/140bytes/wiki/Byte-saving-techniques).

    140byt.es is brought to you by [Jed Schmidt](http://jed.is), with help from Alex Kloss. It was inspired by work from [Thomas Fuchs](http://mir.aculo.us) and [Dustin Diaz](http://www.dustindiaz.com/).
    140byt.es is brought to you by [Jed Schmidt](http://jed.is), with help from Alex Kloss. It was inspired by work from [Thomas Fuchs](http://mir.aculo.us) and [Dustin Diaz](http://www.dustindiaz.com/).
  5. aemkei revised this gist Apr 21, 2012. 1 changed file with 6 additions and 5 deletions.
    11 changes: 6 additions & 5 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -7,11 +7,12 @@ A simplified variant of the classic tetris game done in less that 140 bytes of J
    ### Source

    ```javascript
    function(a,b,c,d,e){return d+=c,
    e=a|b<<d,d<0|a&b<<d&&(a=e=
    parseInt((a|b<<c).toString(d=32)
    .replace(/v/,""),d),b=new Date%2?1:3),
    [a,b,d,e]}
    function(a,b,c,d){d+=c;
    return[d<0|a&b<<d?a=
    parseInt((a|b<<c)
    .toString(d=32,b=new Date&2|1)
    .replace('v',''),d):
    a|b<<d,a,b,d]}
    ```

    Feel free to [edit](http://jsbin.com/egiqul/49/edit#javascript,live) the source and follow me on Twitter ([@aemkei](http://twitter.com/aemkei)).
  6. aemkei revised this gist Feb 14, 2012. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,4 @@
    Binary Tetris - 140byt.es
    ======================================
    # Binary Tetris - 140byt.es

    A simplified variant of the classic tetris game done in less that 140 bytes of JavaScript.

  7. aemkei revised this gist Feb 14, 2012. 1 changed file with 10 additions and 0 deletions.
    10 changes: 10 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -5,6 +5,16 @@ A simplified variant of the classic tetris game done in less that 140 bytes of J

    [**Click here to play the DEMO**](http://jsbin.com/egiqul/49)!

    ### Source

    ```javascript
    function(a,b,c,d,e){return d+=c,
    e=a|b<<d,d<0|a&b<<d&&(a=e=
    parseInt((a|b<<c).toString(d=32)
    .replace(/v/,""),d),b=new Date%2?1:3),
    [a,b,d,e]}
    ```

    Feel free to [edit](http://jsbin.com/egiqul/49/edit#javascript,live) the source and follow me on Twitter ([@aemkei](http://twitter.com/aemkei)).

    ### Example Layout
  8. aemkei revised this gist Feb 2, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@ Binary Tetris - 140byt.es

    A simplified variant of the classic tetris game done in less that 140 bytes of JavaScript.

    [**Play the demo at http://jsbin.com/egiqul/49**](http://jsbin.com/egiqul/49)!
    [**Click here to play the DEMO**](http://jsbin.com/egiqul/49)!

    Feel free to [edit](http://jsbin.com/egiqul/49/edit#javascript,live) the source and follow me on Twitter ([@aemkei](http://twitter.com/aemkei)).

  9. aemkei revised this gist Feb 2, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@ Binary Tetris - 140byt.es

    A simplified variant of the classic tetris game done in less that 140 bytes of JavaScript.

    [**Play the demo** at http://jsbin.com/egiqul/49](http://jsbin.com/egiqul/48)!
    [**Play the demo at http://jsbin.com/egiqul/49**](http://jsbin.com/egiqul/49)!

    Feel free to [edit](http://jsbin.com/egiqul/49/edit#javascript,live) the source and follow me on Twitter ([@aemkei](http://twitter.com/aemkei)).

  10. aemkei revised this gist Feb 2, 2012. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,9 @@ Binary Tetris - 140byt.es

    A simplified variant of the classic tetris game done in less that 140 bytes of JavaScript.

    Play the demo at [http://jsbin.com/egiqul/49](http://jsbin.com/egiqul/48), feel free to [edit](http://jsbin.com/egiqul/49/edit#javascript,live) the source and follow me on Twitter ([@aemkei](http://twitter.com/aemkei)).
    [**Play the demo** at http://jsbin.com/egiqul/49](http://jsbin.com/egiqul/48)!

    Feel free to [edit](http://jsbin.com/egiqul/49/edit#javascript,live) the source and follow me on Twitter ([@aemkei](http://twitter.com/aemkei)).

    ### Example Layout

  11. aemkei revised this gist Feb 2, 2012. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -3,6 +3,8 @@ Binary Tetris - 140byt.es

    A simplified variant of the classic tetris game done in less that 140 bytes of JavaScript.

    Play the demo at [http://jsbin.com/egiqul/49](http://jsbin.com/egiqul/48), feel free to [edit](http://jsbin.com/egiqul/49/edit#javascript,live) the source and follow me on Twitter ([@aemkei](http://twitter.com/aemkei)).

    ### Example Layout

    1. 2. 3. 4. 5.
    @@ -14,7 +16,7 @@ A simplified variant of the classic tetris game done in less that 140 bytes of J
    ##... ##... ##.## ##... .....
    ###.. ###.. ###.. ##### ##...

    Play the demo at [http://jsbin.com/egiqul/49](http://jsbin.com/egiqul/48) and feel free to [edit](http://jsbin.com/egiqul/49/edit#javascript,live) the source!


    ### More Information

  12. aemkei revised this gist Jan 27, 2012. 1 changed file with 8 additions and 6 deletions.
    14 changes: 8 additions & 6 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -5,12 +5,14 @@ A simplified variant of the classic tetris game done in less that 140 bytes of J

    ### Example Layout

    .....
    .....
    ...##
    .....
    ##...
    ###..
    1. 2. 3. 4. 5.

    ..... ..... ..... ..... .....
    ..... ..... ..... ..... .....
    ...## ..... ..... ..... .....
    ..... ...## ..... ..... .....
    ##... ##... ##.## ##... .....
    ###.. ###.. ###.. ##### ##...

    Play the demo at [http://jsbin.com/egiqul/49](http://jsbin.com/egiqul/48) and feel free to [edit](http://jsbin.com/egiqul/49/edit#javascript,live) the source!

  13. aemkei revised this gist Jan 27, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -12,7 +12,7 @@ A simplified variant of the classic tetris game done in less that 140 bytes of J
    ##...
    ###..

    Play the demo at [http://jsbin.com/egiqul/48](http://jsbin.com/egiqul/48) and feel free to [edit](http://jsbin.com/egiqul/48/edit#javascript,live) the source!
    Play the demo at [http://jsbin.com/egiqul/49](http://jsbin.com/egiqul/48) and feel free to [edit](http://jsbin.com/egiqul/49/edit#javascript,live) the source!

    ### More Information

  14. aemkei revised this gist Jan 27, 2012. 2 changed files with 2 additions and 2 deletions.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    Tetris Clone - 140byt.es
    Binary Tetris - 140byt.es
    ======================================

    A simplified variant of the classic tetris game done in less that 140 bytes of JavaScript.
    2 changes: 1 addition & 1 deletion package.json
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    {
    "name": "tetris",

    "description": "A variant of the classic Tetris game.",
    "description": "A binary variant of the classic Tetris game.",

    "keywords": [
    "tetris",
  15. aemkei revised this gist Jan 27, 2012. 2 changed files with 2 additions and 2 deletions.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    TETRIS Clone - 140byt.es
    Tetris Clone - 140byt.es
    ======================================

    A simplified variant of the classic tetris game done in less that 140 bytes of JavaScript.
    2 changes: 1 addition & 1 deletion package.json
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    {
    "name": "tetris",

    "description": "A variant of the classic tetris game.",
    "description": "A variant of the classic Tetris game.",

    "keywords": [
    "tetris",
  16. aemkei revised this gist Jan 27, 2012. 2 changed files with 6 additions and 8 deletions.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    TETRIS Clone - 140byt.es
    ======================================

    A simplified variant of to the classic tetris game done in less that 140 bytes of JavaScript.
    A simplified variant of the classic tetris game done in less that 140 bytes of JavaScript.

    ### Example Layout

    12 changes: 5 additions & 7 deletions package.json
    Original file line number Diff line number Diff line change
    @@ -1,13 +1,11 @@
    {
    "name": "theNameOfYourLibWhichMustBeAValidCamelCasedJavaScriptIdentifier",
    "name": "tetris",

    "description": "This should be a short description of your entry.",
    "description": "A variant of the classic tetris game.",

    "keywords": [
    "five",
    "descriptive",
    "keywords",
    "or",
    "fewer"
    "tetris",
    "game",
    "binary"
    ]
    }
  17. aemkei revised this gist Jan 27, 2012. 4 changed files with 167 additions and 36 deletions.
    79 changes: 62 additions & 17 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -1,26 +1,71 @@
    140byt.es
    =========
    TETRIS Clone - 140byt.es
    ======================================

    A tweet-sized, fork-to-play, community-curated collection of JavaScript.
    A simplified variant of to the classic tetris game done in less that 140 bytes of JavaScript.

    How to play
    -----------
    ### Example Layout

    1. Click the ![Fork](https://d3nwyuy0nl342s.cloudfront.net/images/gist/buttons/fork_button.png) button above to fork this gist.
    2. Modify all the files to according to the rules below.
    3. Save your entry and tweet it up!
    .....
    .....
    ...##
    .....
    ##...
    ###..

    Keep in mind that thanks to the awesome sensibilities of the GitHub team, gists are just repos. So feel free to clone yours and work locally for a more comfortable environment, and to allow commit messages.
    Play the demo at [http://jsbin.com/egiqul/48](http://jsbin.com/egiqul/48) and feel free to [edit](http://jsbin.com/egiqul/48/edit#javascript,live) the source!

    ### More Information

    The main logic to move blocks, detect collision, assign new blocks, remove full lines and render the layout are included. Excluded are keyboard controls and the final rendering.

    This version is heavy based on binary numbers and bit shift operators. I had to limit the board size to 5x6 (30 bits), because JavaScript converts numbers to 32-bit integers when using bitwise operators. The two left bits are later uses to add the correct padding when dealing with numbers that start with "0".


    ### Basic Concept

    The Board

    00000 .....
    798 11000 => ##...
    11110 ####.

    The Block

    3 00011 => ...##


    Checking for Collision

    00000 .....
    798&3 = 2 00000 => .....
    00010 ...X.

    Moving the Block at X Axis

    3 << 1 = 6 00110 => ..##.

    Moving the Block at Y Axis

    00011 ...##
    3<<10 = 3072 00000 => .....
    00000 .....

    Combining Block and Board

    00011 ...##
    798|3072 = 3870 11000 => ##...
    11110 ####.



    Find full line (using base 32)

    00011 3
    3999 11100 => s
    11111 v

    Rules
    -----
    All entries must exist in an `index.js` file, whose contents are

    1. an assignable, valid Javascript expression that
    2. contains no more than 140 bytes, and
    3. does not leak to the global scope.

    All entries must also be licensed under the [WTFPL](http://sam.zoy.org/wtfpl/) or equally permissive license.

    For more information
    --------------------
    @@ -29,4 +74,4 @@ See the [140byt.es](http://140byt.es) site for a showcase of entries (built itse

    To learn about byte-saving hacks for your own code, or to contribute what you've learned, head to [the wiki](https://github.com/jed/140bytes/wiki/Byte-saving-techniques).

    140byt.es is brought to you by [Jed Schmidt](http://jed.is), with help from Alex Kloss. It was inspired by work from [Thomas Fuchs](http://mir.aculo.us) and [Dustin Diaz](http://www.dustindiaz.com/).
    140byt.es is brought to you by [Jed Schmidt](http://jed.is), with help from Alex Kloss. It was inspired by work from [Thomas Fuchs](http://mir.aculo.us) and [Dustin Diaz](http://www.dustindiaz.com/).
    53 changes: 44 additions & 9 deletions annotated.js
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,45 @@
    function(){
    // make sure
    // to annotate
    // your code
    // so everyone
    // can learn
    // from it!
    // see jed's entries
    // for examples.
    function (

    a, // current board
    b, // current block
    c, // current position
    d, // new block offset for position

    e // placeholder: the layout to return
    ){

    return

    d += c, // add offset to position

    e = a | b << d, // render layout based on board and moved block

    d < 0 | a & b<<d // check if block touches bottom line
    // or if block collide with board ...

    && ( // ... if so ...

    a = e = // assign new board and layout
    parseInt( // convert back from base 32

    ( a | b << c ) // get board based on last position
    .toString( // convert board to base 32 (2^5)
    d = 32 // reset block position to top (32)
    )
    .replace(/v/, ""), // remove filled line ("v" = 11111)

    d // base 32 (2^5) for parseInt
    ),

    b = new Date % 2 ? // generate new block for next round
    1 : // single "#" (1 => 1)
    3 // double "##" (3 => 111)
    ),

    [ // the final return
    a, // new board
    b, // new block
    d, // new position
    e // final layout to render
    ]
    }
    2 changes: 1 addition & 1 deletion index.js
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    function(){/* Your entry, a useful, unique, and valid JavaScript expression that packs as much functionality into 140 bytes as possible. */}
    function(a,b,c,d,e){return d+=c,e=a|b<<d,d<0|a&b<<d&&(a=e=parseInt((a|b<<c).toString(d=32).replace(/v/,""),d),b=new Date%2?1:3),[a,b,d,e]}
    69 changes: 60 additions & 9 deletions test.html
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,63 @@
    <!DOCTYPE html>
    <title>Foo</title>
    <div>Expected value: <b>undefined</b></div>
    <div>Actual value: <b id="ret"></b></div>
    <html>
    <style>body{ font-family: monospace; font-size: 20px}</style>
    <div id="output"></div>
    </html>

    <script>
    // write a small example that shows off the API for your example
    // and tests it in one fell swoop.
    var t =
    function(a,b,c,d,e){return d+=c,e=a|b<<d,d<0|a&b<<d&&(a=e=parseInt((a|b<<c).toString(d=32).replace(/v/,""),d),b=new Date%2?1:3),[a,b,d,e]}

    // Controller and Display

    var out = document.getElementById("output");

    var board = 0,
    block = 3,
    position = 32,
    display;

    function update(offset){

    var txt = "",
    result = t(board,block,position, offset);

    board = result[0];
    block = result[1]
    position = result[2]
    display = result[3];

    display = ( 1<<30 | + display ).toString(2);

    for(var i=1; i<31;i++){
    txt += display[i] == "1" ? "#" : ".";
    if(i%5 == 0) txt+= "<br>";
    }

    out.innerHTML = txt;
    }

    update(0);

    onkeydown = function(e){

    var offset = 0;

    switch (e.keyCode){
    case 37: offset = 1; break;
    case 39: offset = -1; break;
    case 40: offset = -5; break;
    }

    update(offset);
    }

    var speed = 1000;

    var myFunction = function(){ /* the code here should be identical to the entry. */ }
    function loop(){
    update(-5);
    setTimeout(loop, speed-=5);
    }

    loop();

    document.getElementById( "ret" ).innerHTML = myFunction()
    </script>
    </script>
  18. @140bytes 140bytes revised this gist Jul 28, 2011. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -25,7 +25,7 @@ All entries must also be licensed under the [WTFPL](http://sam.zoy.org/wtfpl/) o
    For more information
    --------------------

    See the [140byt.es](http://140byt.es) for a showcase of entries built itself using 140-byte entries, and follow [@140bytes](http://twitter.com/140bytes) on Twitter.
    See the [140byt.es](http://140byt.es) site for a showcase of entries (built itself using 140-byte entries!), and follow [@140bytes](http://twitter.com/140bytes) on Twitter.

    To learn about byte-saving hacks for your own code, or to contribute what you've learned, head to [the wiki](https://github.com/jed/140bytes/wiki/Byte-saving-techniques).

  19. @140bytes 140bytes revised this gist Jul 28, 2011. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -25,8 +25,8 @@ All entries must also be licensed under the [WTFPL](http://sam.zoy.org/wtfpl/) o
    For more information
    --------------------

    The [140byt.es](http://140byt.es) site hasn't launched yet, but for now follow [@140bytes](http://twitter.com/140bytes) on Twitter.
    See the [140byt.es](http://140byt.es) for a showcase of entries built itself using 140-byte entries, and follow [@140bytes](http://twitter.com/140bytes) on Twitter.

    To learn about byte-saving hacks for your own code, or to contribute what you've learned, head to [the wiki](https://github.com/jed/140bytes/wiki/Byte-saving-techniques).

    140byt.es is brought to you by [Jed Schmidt](http://jed.is). It was inspired by work from [Thomas Fuchs](http://mir.aculo.us) and [Dustin Diaz](http://www.dustindiaz.com/).
    140byt.es is brought to you by [Jed Schmidt](http://jed.is), with help from Alex Kloss. It was inspired by work from [Thomas Fuchs](http://mir.aculo.us) and [Dustin Diaz](http://www.dustindiaz.com/).
  20. @140bytes 140bytes revised this gist Jun 1, 2011. 1 changed file with 5 additions and 7 deletions.
    12 changes: 5 additions & 7 deletions test.html
    Original file line number Diff line number Diff line change
    @@ -1,14 +1,12 @@
    <!DOCTYPE html>
    <body>
    <div>Expected value: <b>undefined</b></div>
    <div>Actual value: <b id="ret"></b></div>
    </body>
    <!DOCTYPE html>
    <title>Foo</title>
    <div>Expected value: <b>undefined</b></div>
    <div>Actual value: <b id="ret"></b></div>
    <script>
    // write a small example that shows off the API for your example
    // and tests it in one fell swoop.

    var myFunction = function(){ /* the code here should be identical to the entry. */ }
    var ret = myFunction()

    document.getElementById( "ret" ).innerHTML = ret
    document.getElementById( "ret" ).innerHTML = myFunction()
    </script>
  21. @140bytes 140bytes revised this gist Jun 1, 2011. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions test.html
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,4 @@
    <!DOCTYPE html>
    <body>
    <div>Expected value: <b>undefined</b></div>
    <div>Actual value: <b id="ret"></b></div>
  22. @140bytes 140bytes revised this gist May 31, 2011. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion test.html
    Original file line number Diff line number Diff line change
    @@ -9,5 +9,5 @@
    var myFunction = function(){ /* the code here should be identical to the entry. */ }
    var ret = myFunction()

    document.getElementById( "ret" ) = ret
    document.getElementById( "ret" ).innerHTML = ret
    </script>
  23. @140bytes 140bytes revised this gist May 31, 2011. 1 changed file with 13 additions and 0 deletions.
    13 changes: 13 additions & 0 deletions test.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    <body>
    <div>Expected value: <b>undefined</b></div>
    <div>Actual value: <b id="ret"></b></div>
    </body>
    <script>
    // write a small example that shows off the API for your example
    // and tests it in one fell swoop.

    var myFunction = function(){ /* the code here should be identical to the entry. */ }
    var ret = myFunction()

    document.getElementById( "ret" ) = ret
    </script>
  24. @140bytes 140bytes revised this gist May 31, 2011. 3 changed files with 17 additions and 19 deletions.
    17 changes: 9 additions & 8 deletions annotated.js
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,10 @@
    function(){
    /* Rules:
    (1) anonymous function or IIFE // make sure
    (2) may execute immediately // to annotate
    (3) <=140 bytes // your code
    (4) no globals // so everyone
    (5) permissive license // can learn
    (6) have a good time! // from it!
    */}
    // make sure
    // to annotate
    // your code
    // so everyone
    // can learn
    // from it!
    // see jed's entries
    // for examples.
    }
    2 changes: 1 addition & 1 deletion index.js
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    function(){/******************************************************************************************************************************/}
    function(){/* Your entry, a useful, unique, and valid JavaScript expression that packs as much functionality into 140 bytes as possible. */}
    17 changes: 7 additions & 10 deletions package.json
    Original file line number Diff line number Diff line change
    @@ -1,16 +1,13 @@
    {
    // [REQUIRED] A name for your library.
    // This must match /^[a-z_]\w*$/i
    "name": "140bytes",
    "name": "theNameOfYourLibWhichMustBeAValidCamelCasedJavaScriptIdentifier",

    // [OPTIONAL] A description of your library, phrased as a verb predicate.
    // The gist description is used by default.
    "description": "Explain the 140byt.es rules.",
    "description": "This should be a short description of your entry.",

    // [OPTIONAL] Up to 5 keywords used for indexing.
    "keywords": [
    "140bytes",
    "master",
    "rules"
    "five",
    "descriptive",
    "keywords",
    "or",
    "fewer"
    ]
    }
  25. @140bytes 140bytes revised this gist May 26, 2011. 1 changed file with 6 additions and 6 deletions.
    12 changes: 6 additions & 6 deletions annotated.js
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,9 @@
    function(){
    /* Rules:
    (1) anonymous function // make sure
    (2) may execute immediately // to annotate
    (3) <=140 bytes // your code
    (4) no globals // so everyone
    (5) permissive license // can learn
    (6) have a good time! // from it!
    (1) anonymous function or IIFE // make sure
    (2) may execute immediately // to annotate
    (3) <=140 bytes // your code
    (4) no globals // so everyone
    (5) permissive license // can learn
    (6) have a good time! // from it!
    */}
  26. @140bytes 140bytes revised this gist May 25, 2011. 3 changed files with 8 additions and 8 deletions.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -16,7 +16,7 @@ Rules
    -----
    All entries must exist in an `index.js` file, whose contents are

    1. an assignable, valid Javascript expression, that
    1. an assignable, valid Javascript expression that
    2. contains no more than 140 bytes, and
    3. does not leak to the global scope.

    12 changes: 6 additions & 6 deletions annotated.js
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,9 @@
    function(){
    /* Rules:
    (1) anonymous function // make sure
    (2) may be self-executing // to annotate
    (3) <=140 bytes // your code
    (4) no globals // so everyone
    (5) MIT license // can learn
    (6) have a good time! // from it!
    (1) anonymous function // make sure
    (2) may execute immediately // to annotate
    (3) <=140 bytes // your code
    (4) no globals // so everyone
    (5) permissive license // can learn
    (6) have a good time! // from it!
    */}
    2 changes: 1 addition & 1 deletion index.js
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    function(){/*Rules: (1) anonymous function (2) may be self-executing (3) <=140 bytes (4) no globals (5) MIT license (6) have a good time!*/}
    function(){/******************************************************************************************************************************/}
  27. @140bytes 140bytes revised this gist May 23, 2011. 2 changed files with 14 additions and 21 deletions.
    33 changes: 13 additions & 20 deletions LICENSE.txt
    Original file line number Diff line number Diff line change
    @@ -1,20 +1,13 @@
    Copyright (c) 2011 YOUR_NAME_HERE, YOUR_URL_HERE

    Permission is hereby granted, free of charge, to any person obtaining
    a copy of this software and associated documentation files (the
    "Software"), to deal in the Software without restriction, including
    without limitation the rights to use, copy, modify, merge, publish,
    distribute, sublicense, and/or sell copies of the Software, and to
    permit persons to whom the Software is furnished to do so, subject to
    the following conditions:

    The above copyright notice and this permission notice shall be
    included in all copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
    NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
    LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
    OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
    WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
    DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
    Version 2, December 2004

    Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>

    Everyone is permitted to copy and distribute verbatim or modified
    copies of this license document, and changing it is allowed as long
    as the name is changed.

    DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
    TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

    0. You just DO WHAT THE FUCK YOU WANT TO.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -20,7 +20,7 @@ All entries must exist in an `index.js` file, whose contents are
    2. contains no more than 140 bytes, and
    3. does not leak to the global scope.

    All entries must also be licensed under a license as or more permitting than the MIT license.
    All entries must also be licensed under the [WTFPL](http://sam.zoy.org/wtfpl/) or equally permissive license.

    For more information
    --------------------
  28. @140bytes 140bytes revised this gist May 23, 2011. 1 changed file with 3 additions and 4 deletions.
    7 changes: 3 additions & 4 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -16,12 +16,11 @@ Rules
    -----
    All entries must exist in an `index.js` file, whose contents are

    1. a valid Javascript function expression, that
    2. optionally self-executes,
    1. an assignable, valid Javascript expression, that
    2. contains no more than 140 bytes, and
    3. does not pollute global scope.
    3. does not leak to the global scope.

    All entries must also be licensed under the MIT license.
    All entries must also be licensed under a license as or more permitting than the MIT license.

    For more information
    --------------------
  29. @140bytes 140bytes revised this gist May 22, 2011. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -10,6 +10,8 @@ How to play
    2. Modify all the files to according to the rules below.
    3. Save your entry and tweet it up!

    Keep in mind that thanks to the awesome sensibilities of the GitHub team, gists are just repos. So feel free to clone yours and work locally for a more comfortable environment, and to allow commit messages.

    Rules
    -----
    All entries must exist in an `index.js` file, whose contents are
  30. @140bytes 140bytes revised this gist May 21, 2011. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -26,4 +26,6 @@ For more information

    The [140byt.es](http://140byt.es) site hasn't launched yet, but for now follow [@140bytes](http://twitter.com/140bytes) on Twitter.

    To learn about byte-saving hacks for your own code, or to contribute what you've learned, head to [the wiki](https://github.com/jed/140bytes/wiki/Byte-saving-techniques).

    140byt.es is brought to you by [Jed Schmidt](http://jed.is). It was inspired by work from [Thomas Fuchs](http://mir.aculo.us) and [Dustin Diaz](http://www.dustindiaz.com/).