Reference Source

Function

Static Public Summary
public

Initialize the default game setup.

public

randomInt(max: number, min: number): number

Returns a random integer between min and max.

public

Naive shuffle an array, swaps random slots 3 * array.length times.

Static Public

public initDefaultGame(): Game source

Initialize the default game setup.

Return:

Game

a game intialized with default rounds and no players.

public randomInt(max: number, min: number): number source

Returns a random integer between min and max.

Params:

NameTypeAttributeDescription
max number

upper bound (exclusive).

min number

lower bound (inclusive).

Return:

number

random integer.

public shuffleArray(arr: Object[]): Object[] source

Naive shuffle an array, swaps random slots 3 * array.length times.

Params:

NameTypeAttributeDescription
arr Object[]

an array to shuffle.

Return:

Object[]

shuffled array.