CyclicalNumberGenerator

public final class CyclicalNumberGenerator : Randomizer

A “random” number generator that returns numbers in a pre‐determined cycle.

  • Creates a cyclical number generator that returns numbers according to sequence.

    Precondition

    sequence is not empty.

    Declaration

    Swift

    public init(_ sequence: [UIntMax])

    Parameters

    sequence

    The sequence.

  • Returns the next value in the sequence.

    Declaration

    Swift

    public func randomNumber() -> UIntMax