Skip to content
FutureBlitz

    Install

    Import std.math.random

    T[]

    std.math.random

    extend

    Extend T[]

    Shuffling every array, and sampling from it, by the thread's default generator or a Random.

    std/math/random.fb, line 461

    • Public Method Shuffle() method #

      Puts the elements in a random order, in place, each order as likely, from this thread's default generator.

    • Public Method Shuffle(random: Random) method #

      Puts the elements in a random order, in place, each order as likely, from the generator.

    • @PanicsAtCaller Public Method Sample(count: Int): T[] method #

      count of the elements, none twice, in a random order, as a new array, from this thread's default generator. A count below 0 or above the elements' panics.

    • @PanicsAtCaller Public Method Sample(count: Int, random: Random): T[] method #

      count of the elements, none twice, in a random order, as a new array, from the generator. A count below 0 or above the elements' panics.

    Report an issue with this page or with FutureBlitz on GitHub.