GetRandomInt
- Parameters
-
lowBound integer
The inclusive lower bound of the random number returned
highBound integer
The inclusive higher bound of the random number returned
- bug
If you call
GetRandomInt(INT_MIN, INT_MAX)
orGetRandomInt(INT_MAX, INT_MIN)
it will always return the same value, namelyINT_MIN
orINT_MAX
.- comment
Returns a random integer in the range [lowBound, highBound].
- note
See http://hiveworkshop.com/threads/random.286109#post-3073222 for an overview of the algorithm used.
- note
If lowBound > highBound then it just swaps the values.
- return type
integer
- Source code
native GetRandomInt takes integer lowBound, integer highBound returns integer
- Source
- random.j
- wc3modding.com
- GetRandomInt