Whole Method

See Also Applies To Example Model

Returns a random whole number drawn from a Uniform distribution.

object expression.Whole([Low], [High])

object expression    Required. An object expression that evaluates to an object in the Applies To list.

Low    Optional Double. The lower bounds of the distribution. Defaults to 0.

High    Optional Double. The upper bounds of the distribution. Defaults to 1.

Remarks

The Whole method draws randomly from a Uniform distribution.

Example

The following example sets the speed of a Bot object by a random whole number between 1 and 5.

Bot.Speed World.Random.Whole(1, 5)

The following example uses the Whole method for assigning a random value drawn from a Uniform distribution to a BotTag.

Bot.Tags("fitness").Value = World.Random.Whole(0,100)