Commit Graph

2 Commits

Author SHA1 Message Date
Bob Nystrom
19d7215412 feat: add sample(list) and sample(list, count) methods to Random class with two sampling algorithms 2016-02-09 15:24:45 +00:00
Bob Nystrom
813594b14c feat: add Random.shuffle() method using Fisher-Yates algorithm
Implement in-place shuffle for lists on the Random class, using the Fisher-Yates algorithm to ensure uniform permutation distribution. Includes documentation with usage examples, Wren source implementation, and a test suite covering empty lists, single-element lists, and verification that all 24 permutations of a 4-element list are reachable.
2016-02-07 18:38:39 +00:00