Skip to content

Instantly share code, notes, and snippets.

@unitycoder
Last active August 29, 2015 14:25
Show Gist options
  • Select an option

  • Save unitycoder/7923ad5ba457caea3451 to your computer and use it in GitHub Desktop.

Select an option

Save unitycoder/7923ad5ba457caea3451 to your computer and use it in GitHub Desktop.

Revisions

  1. unitycoder revised this gist Jul 20, 2015. 1 changed file with 5 additions and 2 deletions.
    7 changes: 5 additions & 2 deletions gistfile1.js
    Original file line number Diff line number Diff line change
    @@ -3,9 +3,12 @@ var width=3;
    var height=3;
    var size = width*height;

    var x = 0;
    var y = 0;
    for (var i = 0; i < size; i++)
    {
    var x = (i / 3) | 0;
    var y = i % 3;
    x = (i / 3) | 0;
    y = i % 3;
    document.getElementById('output').innerHTML += "x:"+x+" y:"+y+"\n";
    }

  2. unitycoder revised this gist Jul 20, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.js
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    // 2 loops in 1 : https://jsfiddle.net/rntasz32/
    // 2 loops in 1 : https://jsfiddle.net/rntasz32/2/
    var width=3;
    var height=3;
    var size = width*height;
  3. unitycoder created this gist Jul 20, 2015.
    11 changes: 11 additions & 0 deletions gistfile1.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    // 2 loops in 1 : https://jsfiddle.net/rntasz32/
    var width=3;
    var height=3;
    var size = width*height;

    for (var i = 0; i < size; i++)
    {
    var x = (i / 3) | 0;
    var y = i % 3;
    document.getElementById('output').innerHTML += "x:"+x+" y:"+y+"\n";
    }