Rand

From Game Editor

Jump to: navigation, search

rand is one of the simpler functions. It takes what value you enter and returns a random number between 0 and your value.

Example:

int a;
a = rand(5);

The function returns a value that is equal to a random number from 0 to 4. Remember that rand by default returns a double and treats your supplied value as a double.

Retrieved from "http://game-editor.com/Rand"