Documentation ¶
Index ¶
- Constants
- func Abs[T Signed](a T) T
- func Clamp[T Number](v T, min T, max T) T
- func Floor[T Float](v T) T
- func Fract[T Float](v T) T
- func GetOne[T any](arr []T, seed ...uint64) T
- func Lerp[T Number, T1 Float](t T1, a, b T) T
- func Max[T Number](x, y T) T
- func MaxArr[T Number](v []T) T
- func Min[T Number](x, y T) T
- func MinArr[T Number](v []T) T
- func OneIn[T Number](chance T, seed ...uint64) bool
- func PickOne[T any](arr []T, seed ...uint64) (T, []T)
- func PickSome[T any](arr []T, num int, seed ...uint64) ([]T, []T)
- func Porn(seed ...uint64) float64
- func PornInt(seed ...uint64) int
- func Pow[T Number](x, y T) T
- func Range[T Number](start, end T) []T
- func Rng[T Number](val1, val2 T, seed ...uint64) T
- func SRandom(seed ...uint64) float64
- func Shuffle[T any](arr []T, seed ...uint64) []T
- func Sign[T Signed](v T) T
- func Step[T Number](edge T, x T) T
- func Ternary[T any](cond bool, a T, b T) T
- func WeightList(list []int) int
- func WeightSelect[T WeightAble](weightList []T, seed ...uint64) (int, T)
- func XInY[T Number](x T, y T, seed ...uint64) bool
- type Float
- type Number
- type Signed
- type SignedInt
- type UnSigned
- type WeightAble
Constants ¶
View Source
const JSMAXSAFE = 1342177
Variables ¶
This section is empty.
Functions ¶
func WeightList ¶
func WeightSelect ¶
func WeightSelect[T WeightAble](weightList []T, seed ...uint64) (int, T)
Types ¶
type WeightAble ¶
type WeightAble interface {
Weight() float64
}
Click to show internal directories.
Click to hide internal directories.