Bug 1030 : comment in Double Random example wrong
Last modified: 2008-11-20 11:08




Status:
RESOLVED
Resolution:
FIXED -
Priority:
P2
Severity:
normal

 

Reporter:
fjen
Assigned To:
REAS

Attachment Type Created Size Actions

Description:   Opened: 2008-11-19 11:32
comment in Double Random example reads:

"Using 2 random() calls the and point() function .."

should be

"Using 2 random() calls and the point() function"

v0158
Additional Comment #1 From REAS 2008-11-20 11:08
Thanks for the report, I cleaned a few other things up as well:

/**
* Double Random
* by Ira Greenberg.
*
* Using two random() calls and the point() function
* to create an irregular sawtooth line.
*/

size(200, 200);
background(0);
int totalPts = 300;
float steps = totalPts + 1;
stroke(255);
float rand = 0;

for (int i = 1; i < steps; i++){
point( (width/steps) * i, (height/2) + random(-rand, rand) );
rand += random(-5, 5);
}