mwg API
    Preparing search index...

    Interface RandomSource

    The minimal draw surface for the helpers that may draw integers (int, range, normalRange, element, shuffle) as well as floats. Generator and MersenneTwister both satisfy it structurally.

    element stays on this wider type even though it only picks one item: it draws through int(), and re-spelling that draw with float() would change its stream (and break seeded replays that use it), so a float-only source is rejected here rather than silently re-drawn.

    interface RandomSource {
        float(): number;
        int(bound: number): number;
    }

    Hierarchy (View Summary)

    Index
    • an integer in [0, bound), without modulo bias

      Parameters

      • bound: number

      Returns number