Jump to content
  • Advertisement
Sign in to follow this  

Randomizing problem

This topic is 3966 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm a beginner in C programming, I study it for 3 months now. Before that I was using Visual Basic 6 for about five years, so I know the basics. Anyway, I'm creating a little sokoban clone (my first game in C :D ) using SDL (just the basic library), and I've bumped into a problem: I need a fast-changing seed for srand() function. I need to get (maximum) 400 random numbers, as fast as possible, and the srand(time(0)) is just to slow, and I get all 400 numbers the same. So, I need some function that returns a proper number (that I can feed to srand) and does it fast. I tried google-ing for it, but nothing useful came up. Any ideas? Thanks.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!