// spiral.pde // (c) 2013 Marie desJardins // // This is my spiffy new program -- can you tell what it does?! // Try changing the parameters (spiralSize and spiralIncrement) to see // how its behavior changes! // // Mini-challenge: How would you change this program to draw a spiral // that's more stretched out vertically than horizontally? // VARIABLE AND CONSTANT DEFINITIONS // Screen size and spiral parameter (constants) final int width = 700; final int height = 700; final int spiralIncrement = 3; // Current and previous cursor location to let us draw lines int curX = width/2; int curY = height/2; int prevX, prevY; // Variables to keep track of which direction we're going // and how far to move int dir = 0; // 0=east, 1=south, 2=west, 3=north int xDir, yDir; int spiralSize = 1; // MAIN FUNCTION -- setup() void setup () { // Set the screen size size (width, height); // Draw the spiral - Keep going until we run out of room! while ( curX>0 && curX0 && curY