mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-04 02:39:20 +00:00
14 lines
688 B
Python
14 lines
688 B
Python
.seed!: (a := Num, version := Int) => NoneType
|
|
.randbytes!: (n: Nat) => Bytes
|
|
.randrange!: (start: Int, stop := Int, step := Int) => Int
|
|
.randint!: (a: Int, b: Int) => Int
|
|
.getrandbits!: (k: Nat) => Nat
|
|
.choice!: |T: Type, S <: Sequence(T)|(seq: S) => T
|
|
# TODO: dependent length array type
|
|
.choices!: |T: Type, S <: Sequence(T)|(population: S, weights := [Nat; _] or NoneType, k := Nat) => [T; _]
|
|
# TODO: Sequence!
|
|
.shuffle!: |T: Type, S <: Sequence(T)|(seq: S) => NoneType
|
|
.sample!: |T: Type, S <: Sequence(T)|(population: S, k := Nat) => [T; _]
|
|
.random!: () => 0.0..1.0 # TODO: <1.0
|
|
.dep_uniform! = 'uniform': |A: Int, B: Int|(a: {A}, b: {B}) => A..B
|
|
.uniform!: (a: Int, b: Int) => Int
|