Re: Best way to get a non-repeating random number?
Re: Best way to get a non-repeating random number?
- Subject: Re: Best way to get a non-repeating random number?
- From: Peter Castine <email@hidden>
- Date: Thu, 16 Apr 2009 11:51:54 +0200
On 15-Apr-2009, at 18:46, Michael Ash wrote, quoting Eric E. Dolecki:
int result = (arc4random()%9) + 1;
if (result >= activeTarget) ++result;
activeTarget = result;
No it won't.
Sorry, you're right; I was wrong. I wrote after a too brief analysis
of the code. It's actually a rather algorithm. I apologize for the
noise. The punishment for my error is that it will be indexed by
Google for what passes on the Internet as eternity.
My other points about Mersenne Twister burstiness, etc. stand.
-- Peter
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden