Random Subset

Pure
RandomSubset

Returns a random subset of N elements from the array without replacement.

Type: Pure (no side effects)
Category: Fortuna|Array & Collection
Keywords: array & collection

Inputs

NameTypeDefaultDescription
ArrayTArray<int>Array parameter
CountintCount parameter

Outputs

NameTypeDescription
ReturnValueTArray<int>ReturnValue output

Example Use Cases

Example 1

Pick 3 random rewards from a pool of 20.

Example 2

Select N random spawn points from available locations.