Custom Functions

Some of the legacy functions are not fully supported in all editor versions, here are some alternatives. To use a custom function, copy and paste the entire function into your question javascript above the main js_answer() function. If you need a refresher on Javascript function notation, see JavaScript Functions [External, W3 Schools].

Links to functions

2 Range Random Integer - twoRangeRand(lower1,upper1,lower2,upper2)

Description: Returns an integer between lower-bound 1 and upper-bound 1 or lower-bound 2 and upper-bound 2.

Cubic Root Solver - solveCubic(a,b,c,d)

Description: Determines the roots of a provided cubic function.

Quest Format to Tex - questSimplifyTex(string math1, bool includePlus)

Description: This function is intended to simplify expressions provided in a string format.

Random Integer Function - RandomInt(min, max, pm)

Description: Returns a random integer between min and max. If pm is set to -1, it will return a negative number.