feat: add sample(list) and sample(list, count) methods to Random class with two sampling algorithms

This commit is contained in:
Bob Nystrom
2016-02-09 15:24:45 +00:00
parent 813594b14c
commit 19d7215412
11 changed files with 248 additions and 5 deletions
+5
View File
@@ -0,0 +1,5 @@
import "random" for Random
var random = Random.new(12345)
random.sample([1, 2, 3], 4) // expect runtime error: Not enough elements to sample.