int Random(unsigned int range);
Generates a random number from 0 to range minus one.
Return Value
Returns an integer from 0 to one less than the range.
Parameters
range Specifies the upper limit of the random number to be returned. If range is 52 the number returned will be between 0-51.
Remarks
The Random() function generates and returns a random number from 0 to one less than the range specified.
Availability
Available in DragonFireSDK 1.0 and later.
Example
Description: This example will generate a random number between 0 to 51.
#include "DragonFireSDK.h"
void AppMain() { Random(52); }
void AppExit() {
}
void OnTimer() {
}
|