Skip to content

Commit 51945d7

Browse files
committed
Example cleanup for new site launch
1 parent 65d95e9 commit 51945d7

File tree

8 files changed

+31
-36
lines changed

8 files changed

+31
-36
lines changed

Basics/Color/Hue/Hue.pde

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,14 @@
99
int barWidth = 20;
1010
int lastBar = -1;
1111

12-
void setup()
13-
{
12+
void setup() {
1413
size(640, 360);
1514
colorMode(HSB, height, height, height);
1615
noStroke();
1716
background(0);
1817
}
1918

20-
void draw()
21-
{
19+
void draw() {
2220
int whichBar = mouseX / barWidth;
2321
if (whichBar != lastBar) {
2422
int barX = whichBar * barWidth;

Basics/Image/RequestImage/RequestImage.pde

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
/**
22
* Request Image
3-
* by Ira Greenberg ( From Processing for Flash Developers).
3+
* by Ira Greenberg
44
*
55
* Shows how to use the requestImage() function with preloader animation.
66
* The requestImage() function loads images on a separate thread so that
7-
* the sketch does not freeze while they load. It's very useful when you are
8-
* loading large images.
9-
*
10-
* These images are small for a quick download, but try it with your own huge
11-
* images to get the full effect.
7+
* the sketch does not freeze while they load. It's useful when you are
8+
* loading large images. These images are small for a quick download, but
9+
* try it with your own huge images to get the full effect.
1210
*/
1311

1412
int imgCount = 12;

Basics/Math/Interpolate/Interpolate.pde

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Move the mouse across the screen and the symbol will follow.
55
* Between drawing each frame of the animation, the ellipse moves
66
* part of the distance (0.05) from its current position toward
7-
* the cursor using the lerp() function
7+
* the cursor using the lerp() function.
88
*
99
* This is the same as the Easing under input only with lerp() instead.
1010
*/

Basics/Math/OperatorPrecedence/OperatorPrecedence.pde

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
/**
22
* Operator Precedence
33
*
4-
* If you don't explicitly state the order in which
5-
* an expression is evaluated, they are evaluated based
6-
* on the operator precedence. For example, in the statement
7-
* "4+2*8", the 2 will first be multiplied by 8 and then the result will
8-
* be added to 4. This is because the "*" has a higher precedence
9-
* than the "+". To avoid ambiguity in reading the program,
10-
* it is recommended that is statement is written as "4+(2*8)".
11-
* The order of evaluation can be controlled through placement of
12-
* parenthesis in the code. A table of operator precedence follows below.
13-
*
4+
* If you don't direction state the order in which an
5+
* expression is evaluated, it is decided by the operator
6+
* precedence. For example, in the statement "4+2*8", the
7+
* 2 will first be multiplied by 8 and then the result will
8+
* be added to 4. This is because multiplication has a higher
9+
* precedence than addition. To avoid ambiguity in reading
10+
* the program, it is recommended to write the expression as
11+
* "4+(2*8)". The order of evaluation can be controlled through
12+
* adding parenthesis in the code.
1413
*/
1514

1615
// The highest precedence is at the top of the list and

Basics/Math/PolarToCartesian/PolarToCartesian.pde

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
/**
2-
* PolarToCartesian
2+
* Polar to Cartesian
33
* by Daniel Shiffman.
44
*
5-
* Convert a polar coordinate (r,theta) to cartesian (x,y):
6-
* x = r * cos(theta)
7-
* y = r * sin(theta)
5+
* Convert a polar coordinate (r,theta) to cartesian (x,y).
6+
* The calculations are "x = r * cos(theta)" and "y = r * sin(theta)".
87
*/
98

109
float r;
@@ -41,7 +40,7 @@ void draw() {
4140
fill(200);
4241
ellipse(x, y, 32, 32);
4342

44-
// Apply acceleration and velocity to angle (r remains static in this example)
43+
// Apply acceleration and velocity to angle
4544
theta_vel += theta_acc;
4645
theta += theta_vel;
4746

Basics/Shape/DisableStyle/DisableStyle.pde

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
/**
2-
* Ignore Styles.
3-
* Illustration by George Brower.
2+
* Disable Style
3+
* by George Brower.
44
*
55
* Shapes are loaded with style information that tells them how
6-
* to draw (the color, stroke weight, etc.) The disableStyle()
7-
* method of PShape turns off this information. The enableStyle()
8-
* method turns it back on.
6+
* to draw (e.g. color, stroke weight). The disableStyle()
7+
* method of PShape turns off this information so functions like
8+
* stroke() and fill() change the SVGs color. The enableStyle()
9+
* method turns the file's original styles back on.
910
*/
1011

1112
PShape bot;

Basics/Structure/CreateGraphics/CreateGraphics.pde

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* Create Graphics.
33
*
4-
* The createGraphics() function creates an object from the PGraphics class
4+
* The createGraphics() function creates an object from the PGraphics class.
55
* PGraphics is the main graphics and rendering context for Processing.
66
* The beginDraw() method is necessary to prepare for drawing and endDraw() is
77
* necessary to finish. Use this class if you need to draw into an off-screen

Basics/Structure/Redraw/Redraw.pde

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ void setup() {
1717
y = height * 0.5;
1818
}
1919

20-
// The statements in draw() are executed until the
21-
// program is stopped. Each statement is executed in
22-
// sequence and after the last line is read, the first
23-
// line is executed again.
20+
// The code in draw() is run until the program
21+
// is stopped. Each statement is executed in
22+
// sequence and after the last line is read,
23+
// the first line is run again.
2424
void draw() {
2525
background(0); // Set the background to black
2626
y = y - 4;

0 commit comments

Comments
 (0)