takeRandomly

fun <T> SemiOrderedArgsGenerator<T>.takeRandomly(amount: Int, seedOffset: Int = 0): List<T>(source)

Takes randomly the given amount of elements from this SemiOrderedArgsGenerator.

Since

2.0.0


fun <T> Iterable<T>.takeRandomly(amount: Int): List<T>(source)

Takes the given amount of elements from this Iterable (likewise Iterable.take) but in a random way based on the configured VariistConfig.seed.

Since

2.0.0

Throws

in case of an infinite Iterable.


fun <T> Array<T>.takeRandomly(amount: Int): List<T>(source)

Takes the given amount of elements from this Array (likewise Array.take) but in a random way based on the configured VariistConfig.seed.

Since

2.0.0


Takes the given amount of elements from this Sequence (likewise Sequence.take) but in a random way based on the configured VariistConfig.seed.

The operation is intermediate and stateful.

Since

2.0.0

Throws

in case of an infinite Sequence.