Skip to main content
gamedev.net
🔒 Locked

Randome generator code

Started by stefu Mar 22, 2003 at 3:42 AM 3 replies 250+ views
Original Post
stefu
stefu
Could someone paste general random generation gode? I need random to generate some level data and it has to be same everytime in every os, so I cannot use rand(). Thanks
civguy
civguy
Use Boost Random. It''s a library of several random number generators that behave similarly on all OSes.
smart_idiot
smart_idiot
Mersenne Twister
Chess is played by three people. Two people play the game; the third provides moral support for the pawns. The object of the game is to kill your opponent by flinging captured pieces at his head. Since the only piece that can be killed is a pawn, the two armies agree to meet in a pawn-infested area (or even a pawn shop) and kill as many pawns as possible in the crossfire. If the game goes on for an hour, one player may legally attempt to gouge out the other
stefu
stefu
Thanks.
btw. does floating points (specially sin, cos) work similarly in all systems, or is it better to use fixed point values generating level data?
Nypyren
Nypyren
I''ve used the Mersenne Twister... I can say it''s pretty darn random.

Just don''t seed it with zero!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.