Post Reply 
Random Integers, No Repeats
08-09-2023, 03:50 PM
Post: #6
RE: Random Integers, No Repeats
(08-09-2023 04:54 AM)Joe Horn Wrote:  ... rand(X,Y,Z) returns X random integers between Y and Z without repeats. Example: rand(10,50,59) returns all 10 integers between 50 and 59 in random order. It's faster than creating an array and then shuffling it.

I would bet that rand uses the Fisher-Yates algorithm internally. The G2 is very fast and so is Fisher-Yates.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Random Integers, No Repeats - lrdheat - 08-09-2023, 02:30 AM
RE: Random Integers, No Repeats - Joe Horn - 08-09-2023, 04:54 AM
RE: Random Integers, No Repeats - John Keith - 08-09-2023 03:50 PM
RE: Random Integers, No Repeats - nickapos - 08-09-2023, 04:59 PM
RE: Random Integers, No Repeats - Joe Horn - 08-09-2023, 05:10 PM
RE: Random Integers, No Repeats - lrdheat - 08-09-2023, 01:24 PM
RE: Random Integers, No Repeats - Joe Horn - 08-09-2023, 05:31 PM
RE: Random Integers, No Repeats - nickapos - 08-09-2023, 06:04 PM
RE: Random Integers, No Repeats - parisse - 08-09-2023, 06:09 PM



User(s) browsing this thread: 1 Guest(s)