• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Random Number
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Random Number
      • From: Shaun Chu <email@hidden>
References: 
 >Re: Random Number (From: Ondra Cada <email@hidden>)

  • Prev by Date: Contextual Menu not showing up in OLV
  • Next by Date: Re: Overiding keyDown in an NSComboBox
  • Previous by thread: Re: Random Number
  • Next by thread: Re: Random Number
  • Index(es):
    • Date
    • Thread