[haXe] cross-platform pseudorandom numbers

Daniel Cassidy mail at danielcassidy.me.uk
Wed Jul 4 12:03:09 CEST 2007


On 7/4/07, Nicolas Cannasse <ncannasse at motion-twin.com> wrote:
> jhofmann at 321f.net a écrit :
> > For my current project, I will need a way to generate pseudorandom numbers
> > in pure haXe. The project is a Flash game, which records the game and then
> > uploads it to a NekoVM server: the server replays the game and validates
> > the score to prevent hacking the scoreboard. The existing standard library
> > is not good enough for this as it does not allow me to guarantee the
> > predictability of gameplay - the RNG on different platforms varies.
> >
> > Has anyone looked into this before? Any suggestions? I suspect I will have
> > to implement something myself...
>
> http://en.wikipedia.org/wiki/Mersenne_twister
>
> Don't hesitate to post an implementation on the list or haxelib, since
> it might interest other people as well.

How amusing, I've already implemented it :). It doesn't work in Neko
yet, but I'll submit it to haxelib when I get home.

Dan.


More information about the Haxe mailing list