• 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 generator without duplicates?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Random number generator without duplicates?


  • Subject: Re: Random number generator without duplicates?
  • From: Doug McNutt <email@hidden>
  • Date: Tue, 17 Apr 2001 11:00:32 -0600

>How can I get a list of random numbers that does not include any duplicates?

The buzzword for searching is "shuffling". There was an article in Dr. Dobbs Journal about a year ago. You start with an indexed array of integers from 1 to N and move them around at random. It makes a difference whether or not you allow an individual element - a card - to be moved twice. I have a MacPerl script which I have been meaning to update to the Dr. Dobbs recommendations but it works now. if you'd like it - ask.

AppleScript? I don't even know how to typedef an array let alone work with pointers to the elements.
--

-> From the U S of A, the only socialist country that refuses to admit it. <-


  • Follow-Ups:
    • Re: Random number generator without duplicates?
      • From: "M.S.R.F. Schonewille" <email@hidden>
References: 
 >Random number generator without duplicates? (From: email@hidden)

  • Prev by Date: Re: Random number generator without duplicates?
  • Next by Date: Re: Naming Quark boxes - screwed up!
  • Previous by thread: Re: Random number generator without duplicates?
  • Next by thread: Re: Random number generator without duplicates?
  • Index(es):
    • Date
    • Thread