import { RandomUtil } from "https://deno.land/x/sptaki@1.2.0/utils/RandomUtil.d.ts";
Methods
drawRandomFromDict(): any[]
dict: any,
count?: number,
replacement?: boolean,
Draw a random (top level) element of the provided dictionary N times to return an array of N random dictionary keys Drawing can be with or without replacement
drawRandomFromList<T>(): Array<T>
originalList: Array<T>,
count?: number,
replacement?: boolean,
Draw a random element of the provided list N times to return an array of N random elements Drawing can be with or without replacement
getArrayValue<T>(arr: T[]): T
getBiasedRandomNumber(): number
min: number,
max: number,
shift: number,
n: number,
getBool(): boolean
getChance100(chancePercent: number): boolean
Check if number passes a check out of 100
getFloat(min: number, max: number): number
getInt(min: number, max: number): number
getIntEx(max: number): number
getKey(node: any): string
getKeyValue(node: { [x: string]: any; }): any
getNormallyDistributedRandomNumber(): number
mean: number,
sigma: number,
attempt?: number,
Generate a normally distributed random number Uses the Box-Muller transform
getPercentOfValue(): number
percent: number,
number: number,
toFixed?: number,
getStringArrayValue(arr: string[]): string
randInt(low: number, high?: number): number
Draw Random integer low inclusive, high exclusive if high is not set we draw from 0 to low (exclusive)
reduceValueByPercent(number: number, percentage: number): number
Reduce a value by a percentage
rollForChanceProbability(probabilityChance: number): boolean
Rolls for a probability based on chance
shuffle<T>(array: Array<T>): Array<T>
Fisher-Yates shuffle an array