random() \ Language (API) \ Wiring ALPHA 1.0
Author: Hernando Barragán
Description: Wiring is an electronic sketchbook and hardware electronics for developing ideas. It is a context for learning fundamentals of computer programming and prototyping with electronics within the context of the electronic arts.
Keywords: Wiring, Processing, Interactive Media, Electronic Arts, Programming, C, C++, Hernando Barragán

Search wiring.org.co:

Reference for Wiring version 0024+. If you have a previous version, use the reference included with your software. If you see any errors or have any comments, let us know.

Name | ### random()
Examples |
    int val;
    val = random(-40, 40);  // Sets val to a random number between -40 and 40

    int x;
    x = random(5);  // Sets x to a random number between 0 and 5
Description | Generates random numbers. Each time the random() function is called, it returns an unexpected value within the specified range. If one parameter is passed to the function it will return a float between zero and the value of the parameter. The function call random(5) returns values between 0 and 5. If two parameters are passed, it will return a float with a value between the the parameters.
Syntax |
    random(value1);
    random(value1, value2);
Parameters |
value1 | int or float
value2 | int or float
Returns | float
Usage | Application
Related | randomSeed()

Updated on January 11, 2010 09:42:02pm PST