Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

On pseudorandom numbers and Tetris

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?

Name: Anonymous 2009-11-15 13:42

"Admitting to and then exploring that connection was the WHOLE POINT of the book! It never ceases to amaze me how people think they can kill me with ammunition I GIVE THEM. It's rather like when I allow people to punch me in my toned torso."

"It's rather like when I allow people to punch me in my toned torso."

"It's rather like when I allow people to punch me in my toned torso."

"It's rather like when I allow people to punch me in my toned torso."

http://www.mdickie.com/blog.htm

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List