"Javascript DEMO" by Leonardo Boselli
Release along with a website, source text and an interpreter.
The Javascript Sandbox is a room. "Thanks to a simple hack of 'glkote.min.js' from 'Quixe' (the glulx interpreter written in javascript by Andrew Plotkin) it is possible to insert javascript lines of code in Inform7 texts.[line break]For example, 2+3 = $<3+2>$ (where the '5' shown here is calculated by javascript).[paragraph break]Try to write [bold type]js[roman type] followed by a line written in javascript.[line break][italic type](Prova a scrivere [bold type]js[italic type] seguito da una linea di javascript)[roman type][paragraph break]examples / [italic type]esempi[roman type]:[line break]2+3[line break]sqr = function(x) {return x*x}; sqr(7)[line break]var str = ''; for(var ct = 1; ct < 10; ct++) str += ct; str;[line break]alert('Hello');".
Understand "js [text]" as executing. Executing is an action applying to one topic. Carry out executing: say " $< [the topic understood] >$ ".