Write the code that will go into your main function here:
Include Standard Math functions. So you can write sqrt instead of Math.sqrt
Examples
Here are a few examples to get you going with JavaScript:
NOTE: These are very simple examples, don't expect perfect code.
Console Examples (lets you write out to a text box, works like a console):
- "Run (Multiple)" mode only!
Explanation
This is just a simple little tool that lets you code quick algorithums from anywhere.
I often find that I'm in class, or at someones house, and best way to solve something is with
a little code, but this can be a tricky to do as most people don't have a compiler installed.
So this page gives you an on-the-go compiler using good old JavaScript running on your computer (it is not server side executed). Just type in your code above,
hit the button and you get your results. Here is an explanation of the two different 'Run' buttons. Run (Single) - Creates a new page and automatically runs the code Run (Multiple) - Creates a new page with a button on it, click the button and it executes the function you wrote above. This also allows you to run the code multiple times without refreshing.
In both modes you can use the special Write and WriteLine functions which
output text to a console looking thing above. Also the GetLine function gets whatever input is in the input area. This is great if you just need to get some quick output. Of course
you can also just use the 'alert' or whatever functions from JavaScript.