pickRandom
pickRandom(array)
pickRandom(array, number)
pickRandom(array, weights)
pickRandom(array, number, weights)
pickRandom(array, weights, number)
Try it yourself:
| @1 |
pickRandom(0:10)
|
|
| @2 |
pickRandom([1, 3, 1, 6])
|
|
| @3 |
pickRandom([1, 3, 1, 6], 2)
|
|
| @4 |
pickRandom([1, 3, 1, 6], [2, 3, 2, 1])
|
|
| @5 |
pickRandom([1, 3, 1, 6], 2, [2, 3, 2, 1])
|
|
| @6 |
pickRandom([1, 3, 1, 6], [2, 3, 2, 1], 2)
|
See also:
All functions