Name: Anonymous 2009-11-15 11:24
So I'm programming a Tetris clone in Sepples and SDL. I need a method of generating a random number between 0 and 6 (seven different types of blocks) that gives a, more or less, even chance for each value to occur. I could use ctime and cstdlib to generate a pseudorandom number, then modulus that number by 7, but that wouldn't be an even chance. Some pieces would fall more often than others.
How does /prog/ get their pseudorandoms to be convincing?
How does /prog/ get their pseudorandoms to be convincing?