[ANN] Xorshift RNG for HAXE

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[ANN] Xorshift RNG for HAXE

zOOn
Hi!

Just write Haxe implementation of 32-but Xorshift RNG (Marsaglia 2003). Any
comments and suggestions are welcomed.

Gist: https://gist.github.com/865342

Regards,
 Andrew Zhilin.





--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Xorshift RNG for HAXE

Baluta Cristian
Any port is welcome, so congrats. But can you tell what advantages have? You can generate random numbers much simpler.

On Fri, Mar 11, 2011 at 4:24 AM, zOOn <[hidden email]> wrote:
Hi!

Just write Haxe implementation of 32-but Xorshift RNG (Marsaglia 2003). Any
comments and suggestions are welcomed.

Gist: https://gist.github.com/865342

Regards,
 Andrew Zhilin.





--
haXe - an open source web programming language
http://haxe.org



--
Băluță Cristian
http://ralcr.com
http://imagin.ro

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Xorshift RNG for HAXE

zOOn
Baluta Cristian <cristi.baluta@...> writes:

>
>
> Any port is welcome, so congrats. But can you tell what advantages have? You
can generate random numbers much simpler.

There is a nice article about the subject from the author of polygonal lib:
http://lab.polygonal.de/2007/04/21/a-good-pseudo-random-number-generator-prng/

In short - you can't seed Flash RNG (and it is bad most likely).

While I agreed with the author that Mersenne Twister is a bit overkill for
flash games - I strongly disagree with his choice of Linear Congruental RNG!

Marsaglia's Xorshift has the same performance and much better quality.
Mersene Twister - has even better quality but is more complicated in
implementation and 5 times slower.


Cheers!
   Andrew


--
haXe - an open source web programming language
http://haxe.org