He is starting to ask questions about the randomness
of the dice, because a registered member of the game said
he's recorded the stats of about 100 backgammon games
and found that the numbers generated are not so random.
(I haven't seen the data, so I don't know if that's true)

I'd ask to see the data first - or record your own. There are plenty of tests you can make on frequencies and distribution: it's reasonably easy to work out what these should be for, say, 1000 numbers. Psychology plays a part here, and people tend to expect fewer clumps than they get.

I know that Math.random() is not the best random generator
in the world. I also know that a computer can never produce
*really* random numbers.

Actually, there are a few places where you can get genuinely random numbers, created from quantum events or noise in the world. Try http://www.random.org/, for example.

So, my question is this: Should I use some other algorithms
for generating the value of the dice? Or Math.random()
is really good enough? What if this game was connected
to prizes, tournaments etc? Would I have to find something
better then?

If it's connected to prizes, I wouldn't use random() directly (you'd be amazed how seriously people can take this kind of thing). You might want to try using bitmapData.noise or bitmapData.perlinNoise as a source of random data - you can even use some number like the time of a mousedown event as the random seed. I don't think Flash has any way to change the seed for the Math.random method.

Danny
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to