FAQ
Cover
\
Build
\
Source
\
Bugs
\
Reference
\
Libraries
\
Tools
The bugs database has moved
here
.
Bug 1030 : comment in Double Random example wrong
Last modified: 2008-11-20 11:08
P
roject:
processing
trash
Version:
unspecified
Co
m
ponent:
android
book
core
libraries
pde
reference
tools
web
Status:
RESOLVED
Resolution:
FIXED -
Pr
i
ority:
P2
Severity:
normal
Platform
All
O
S:
All
Windows
Mac OS
Linux
Other
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);
}