Code Interpreter

Write any neccasary auxilary functions here:

Write the code that will go into your main function here:

Include standard Math functions so you can write sqrt instead of Math.sqrt. Also includes: sin, cos, tan, acos, asin, atan, log, exp, ln, floor, ciel, round, rand, pow, pi and e.

Equation Evaluator

Variable Name:Value

WARNING: Don't use the ^ (carrot looking thingy) to mean the exponent operator. This has a very different meaning in JavaScript. Instead use the pow function, which works like this: instead of writing 2^3, you write pow(2,3)

Note: You can use engineering notation. So you can write 5E5 or 6.23E-3 to mean 5*10^5 and 6.23*10^-3 (respectively).

Note: Although the above acts like a normal computer algebra system, it is infact merely convering whatever you write into JavaScript and then interpreting it. Also note that you can use in your expressions any functions you defined in the function area above (just not anything in main).


Here are a few examples to get you going with JavaScript, just click on the button and the code will be entered into the boxes above.
NOTE: These are very simple examples, don't expect perfect (or even good) code.
- uses Easy JS's special WriteLine function
- uses the JavaScript 'alert' function.
- As you would imagine.
- Asks for A, B, C in A*x^2 + B*x + C = 0, and the solves for real values of x. No imaginary.
- Shows the number of letters and words in any text entered in the 'Input' section. Very crude, words=number of spaces+1. 'Run (Multiple)' mode only!