Sign in to follow this  
DrWatson

Randomizing problem

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this