/* 6.914, Example 1.0 working with the Processing window: smooth(), width/height, noLoop(), and random numbers 0) Use smooth(); to make the edges of your shapes ... smoother. It will slow down the rendering of your program slightly, but it will make graphics (especially curved ones) look much nicer. (You can use noSmooth(); to turn off the effect.) 1) width and height will by default be the width and height of your window, as given by size in setup(). Don't reassign them; it's frequently useful not to have to remember the size of your window. 2) noLoop() will cause draw() to execute only once. Try uncommenting it in setup() to see the effect in this case. 3) random() will return random numbers in a given range. random(5); //will give a random number between 0 and 5. random(2, 8); will give a random number between 2 and 8. */ void setup(){ size(500, 300); frameRate(3); smooth(); //noLoop(); } void draw(){ background(0); // the circle will only appear in the bottom half of the window ellipse(random(width), random(height/2, height), 50, 50); }