Re: Random Number
Re: Random Number
- Subject: Re: Random Number
- From: Steven Rogers <email@hidden>
- Date: Thu, 28 Feb 2002 16:31:47 -0600
On Thursday, February 28, 2002, at 01:09 PM, Ondra Cada wrote:
Shaun,
Shaun Chu (SC) wrote at Thu, 28 Feb 2002 13:27:37 -0500:
SC> Sorry if this sounds like a dumb question, but how do I get a truly
SC> random number in Cocoa?
Depends on what you call "truly". The standard way is random (see man
random), but I would not use it for a serious statistics ;)
If you need a good random stream, you have to go outside of Cocoa to
generic
libraries, I fear.
Yes, it all depends on what you want. If you just need one random
number, like "heads or tails" at the beginning of a game, or if you're
getting the random number at times related to user interaction, you can
usually base it on time. If you need a stream of random numbers, you'll
need to do something else.
Steve
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.