Sown Random Number Generator, ActionScript

I am looking for a random number generator in actionscript 3.0 that I can use. Math.random () does not have this function.

Thank.

+2
random actionscript-3
04 Oct '11 at 22:30
source share
2 answers
+4
04 Oct 2018-11-22T00:
source share

I mainly use this serialized random function, which is very fast.

var seed:int = 777; const MAX_RATIO:Number = 1 / int.MAX_VALUE; const MIN_MAX_RATIO:Number = -MAX_RATIO; function random():Number { seed ^= (seed << 21); seed ^= (seed >>> 35); seed ^= (seed << 4); if (seed > 0) return seed * MAX_RATIO; return seed * MIN_MAX_RATIO; } 

sources:
http://blog.stroep.nl/2012/07/random-seed-actionscript/
http://en.wikipedia.org/wiki/Linear_congruential_generator

+2
Oct 05 '11 at 8:01
source share



All Articles