Skip to content

Instantly share code, notes, and snippets.

@jonesfish
Last active October 15, 2015 13:23
Show Gist options
  • Select an option

  • Save jonesfish/d6257c4942b4a8c8fe8c to your computer and use it in GitHub Desktop.

Select an option

Save jonesfish/d6257c4942b4a8c8fe8c to your computer and use it in GitHub Desktop.

Revisions

  1. jonesfish revised this gist Oct 15, 2015. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions diamonds.pde
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    PImage diamond = loadImage("img/diamond.png");;
    PImage diamond = loadImage("img/diamond.png");

    size(400,400);

    @@ -11,9 +11,10 @@ float x = 0, y1 = 0, y2 = height-spacingY;

    for (int i=0; i<COUNT; i++){
    x = i*spacingX;
    // 1st diamond
    image(diamond,x,y1);
    y1 += spacingY;

    // 2nd diamond
    image(diamond,x,y2);
    y2 -= spacingY;
    }
  2. jonesfish revised this gist Oct 15, 2015. 1 changed file with 7 additions and 4 deletions.
    11 changes: 7 additions & 4 deletions diamonds.pde
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,7 @@
    PImage diamond = loadImage("img/diamond.png");;

    size(400,400);

    final int COUNT = 5; // 5 diamonds at a line

    float spacingX = width/COUNT;
    @@ -7,10 +11,9 @@ float x = 0, y1 = 0, y2 = height-spacingY;

    for (int i=0; i<COUNT; i++){
    x = i*spacingX;
    // 1st diamond
    image(diamond, x, y1);
    image(diamond,x,y1);
    y1 += spacingY;
    // 2nd diamond
    image(diamond, x, y2);

    image(diamond,x,y2);
    y2 -= spacingY;
    }
  3. jonesfish renamed this gist Oct 15, 2015. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. jonesfish created this gist Oct 15, 2015.
    16 changes: 16 additions & 0 deletions diamonds.de
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    final int COUNT = 5; // 5 diamonds at a line

    float spacingX = width/COUNT;
    float spacingY = height/COUNT;

    float x = 0, y1 = 0, y2 = height-spacingY;

    for (int i=0; i<COUNT; i++){
    x = i*spacingX;
    // 1st diamond
    image(diamond, x, y1);
    y1 += spacingY;
    // 2nd diamond
    image(diamond, x, y2);
    y2 -= spacingY;
    }