I\'m planning on using JavaScript to enter an informatics competition (BIO) tomorrow. However, I can\'t rely on the examiner having a browser with a decent JavaScript engine
If you're using the command-line, I'd execute the script using CSCRIPT.EXE.
ie: CSCRIPT.EXE myscript.js
This is because WScript.Echo from WSCRIPT will create a dialog box and from CSCRIPT outputs a line to the console. Run this in a command window (CMD).
Reading a line from console into variable:
var x = WScript.StdIn.ReadLine();
Where StdIn is a TextStream object. There is also an StdOut which can be used in place of WScript.Echo()...
Writing the output of foo(x) to console: (must run under CSCRIPT)
WScript.Echo(foo(x));
You can use the WScript object to determine which engine you are running under, there's a question/answer for that (VBScript, but uses the same objects under JScript) here.