It’s worth reminding yourself that if you are developing a game that makes use of a computer, and you want to generate random numbers, that computers are not very good at random.
They are great at almost-random, looks-random-to-me and might-as-well-be-random, but if it really needs to be totally random, as in a coin flip random, then it’s hard. My Countdown Game implementation doesn’t really need truly random numbers, online poker sites are not so lucky.
If you really need something to be random, and unduplicatable, then it’s possible, Jeff Atwood talks about it in a post on Card Shuffling on his blog.
You won’t often need poker site levels of randomness, just something that is good enough. I want people to just stop and think about what is good enough before you start throwing around Rand functions and taking bets from credit cards.
December 9, 2009 at 3:27 pm |
Have you checked out http://www.random.org? They generate ‘true’ random numbers (which I use in my paintings) and interesting discussion regarding randomness.
December 10, 2009 at 11:48 am |
I’ve not looked at it before, but they’ve got a good explanation of Pseudo-Random Number Generators (http://www.random.org/randomness/), these are essentially what your computer uses to create random looking numbers.
As the site states, they’ll probably be good enough unless you are really dependent on there being true randomness in you results, in which case you need to find a better source (such as the numbers from the random.org generator).