Skip to content

functions.js

TheEgglet edited this page Jul 8, 2022 · 2 revisions

The functions.js file is related to global functions (ones that do not change player data). Currently, there are 6 functions in it:

bool chance(int ch)

Returns true with a ch% chance. ch is a number between 0 and 100, not 0 and 1.

int countValues(any[] array, any value)

Counts the amount of times value is in array.

any randomValue(any[] array)

Returns a random value from array.

int randomNumber(int min, int max)

Returns a random number between min and max, both inclusive.

any[] removeValue(any[] array, any value)

Removes the first value from array. The array stays like that.

HTMLElement el(string e)

Returns the element with ID e. For convenience, but never used for some reason.