RandomX

Category: Arithmetics
Since engine version: 1.0 OC

Description

Yields a random value from value1 to value2. It does not matter, which limit is greater or less.

Syntax

int RandomX(int value1, int value2);

Parameters

value1:
[opt] Range start
value2:
[opt] Range end

Examples

SetXDir(RandomX(-20,+20));
Sets horizontal speed of the object to a random value between -20 and +20.
Message("Daniel has %d bread rolls!", RandomX(42,23));
Returns the number of Daniel's random bread rolls. This may be a value from 23 to 42.
See also: Random
flgr, 2002-01