dxRnd#(low#,high#)

Parameters

start# = Lowest value to generate
end# = Highest value to generate

Description

This returns either a floating point or integer number of a random value falling between the start and end number. It returns an integer if assiged to an integer variable, and it returns a floating point value if assiged to a floating number variable. The start and end values are inclusive. Be sure to use the dxSeedRnd command to avoid generating the same random numbers every time the program is run.

Example

y=dxRnd(0,10) ; Set y to a random integer between 0 and 10
y#=dxRnd(0,5) ; Set y floating value between 0.000000 and 5.000000

NOTE: This function is not the same as the standard blitz function. Although the syntax and the operation is the same the hardwired version will provide uniform results. In blitz, the rnd values returned by B+ differ from those returned by B3D using the same seed. The hardwired random functions eradicate this difference.


Index