dxRand%(low%,high%)

Parameters

low value = optional - defaults to 1; lowest number to generate
high value = highest number to generate

Description

Unlike the dxRnd command, this command actually returns only integer values. The low value defaults to 1 if no value is specified. The high value is the highest number that can be randomly generated.

If you need to generate floating point random numbers, use dxRnd.

Example

; dxRand example

; Set the randomizer seed for more true random numbers
dxSeedRnd (MilliSecs())

; Generate random numbers between 1 and 100
For t = 1 To 20
dxPrint dxRand(1,100)
Next

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