Files
processing4/web/reference/API/randomSeed.xml
2005-01-27 06:48:42 +00:00

59 lines
941 B
XML

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>randomSeed()</name>
<category>Math</category>
<subcategory>Random</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
randomSeed(0);
for(int i=0; i&lt;100; i++) {
float r = random(0, 255);
stroke(r);
line(i, 0, i, 100);
}
</code>
</example>
<description>
Sets the seed value for <b>random()</b>. By default, <b>random()</b> produces different results each time the program is run. Set the <b>value</b> parameter to a constant to return the same pseudo-random numbers each time the software is run.
</description>
<syntax>
random(<c>value</c>);
</syntax>
<parameter>
<label>value</label>
<description>int</description>
</parameter>
<returns>None</returns>
<related>
random()
noise()
noiseSeed()
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>Core</partof>
<level>Extended</level>
</root>