You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
The default java.util.Random handles calls to
nextInt(x)
wherex
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 everyFrameTick
, 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.The text was updated successfully, but these errors were encountered: