Why are random numbers so freaking difficult?
Why in the hell can't the random number function in XCode work like every other random number function I've used?
I'm writing a game. I need to calculate random numbers every millisecond to calculate deviations from a predefined path. When I used every random number function in the cocoa library, i always get the same numbers no matter when or how I run the app. I've tried making my own random numbers by manipulating the various NSCalendarDate references. I've tried to seed srand() and srandom()with the date, but I always get a improper use of void something or other error. It's really starting to make me angry that I can write complex graphical apps and animations with no problem but a random number generator effectively kicks my butt. Maybe I'm missing something extremely simple.
|