indigo
indigo copied to clipboard
`rollRange` under certain circumstances very likely to return the same result
The default java.util.Random handles calls to nextInt(x)
where x
is a power of two specially.
In Indigo, this leads to the fact that when you do dice.rollRange(1, 4)
at the start of every FrameTick
, you are overwhelmingly likely to get the same number as before.
Possible workaround: call rollRange(1, 4)
(or with any other number) and discard the first return value. Successive calls seem to yield more random values.