This page explains how to operate
including some extensions that are not standard
in the text area in the middle of
Save it in a local text file via copy/paste,
or via the Clone button (see below).
Run the program by clicking the Run button.
This first clears the output area.
Button 'Run & Append Output' will run the program
without clearing the output area.
Run-time errors are reported through an alert window. Warning: Error messages can be uninformative,
since they do not tell where in the program text the error was triggered.
helps prevent errors.
To locate errors,
it can be helpful to comment out parts of the program
and run it again,
and to show intermediate values through the standard function
Clone the machine by clicking the Clone button.
This opens a new machine window with copies of the current input, separator,
program, and output.
The title of the new window displays a clone number.
The button 'Challenge' clears the input and output text areas,
runs the program, and
compares the program text to the program's output.
This is useful for the Challenge. Note: Mind possible newlines at the very end,
because these are also compared.
There is no Clear button to reduce the risk of accidentally deleting
To clear the program area,
click inside, do 'Select All', and either Cut or Delete the selection,
or Paste the Clipboard over it;
alternatively, above the Output text area click 'Clear' and 'Copy to Program'.
The program can write output,
which then appears in the text area on the right,
using the predefined functions
writes each of its multiple arguments to output
like write(), and appends a newline
writes a single quote
Such output is also appended to the predefined variable
(The functions write() and
writeln() are comparable to
that 'inject' the argument strings into the HTML document.
To clear the output text area, click its Clear button.
To copy the output to the program area,
click button 'Copy to Program' above the output area.
This is useful when a program produces as output a program
that you then want to run.
See the Examples for such programs.
The program can process input from the text area on the left.
When you click Run, the text on the left is made
available in the predefined variable input.
The input is also separated into an array of strings
according to the separator
defined in the input field above the input text area
(the default separator is a space).
The separated values can be accessed one by one
using the predefined functions
Whether further separated input values are available is
reported by the predefined function moreInputs(). Warning: Input that is entered after the program has been started,
will not be processed in this way. Notes (for advanced use):
The separator is available
in the predefined variable separator.
This might be useful in output.
The arrray of separated input strings is available
in the predefined variable inputs.
The index of the next input value is available
in the predefined variable
You typically do not need this variable and should not mess with it.
To clear the input text area, click its Clear button.
To copy the program to the input area,
click button 'Copy to Input', above the program area.
To copy the output to the input area,
click button 'Copy to Input', above the output area.
Miscellaneous Predefined Functions and Constants
Some predefined functions are available to recognize characters
(not needed for the Challenge):
determines whether c is a single quote (')
determines whether c is a newline
Some special symbols are available through predefined constants
(use these sparingly; not needed for the Challenge):
QU for a single quote (')
NL for a newline:
on output, moves the writing head to next line
can also be used for comparison to characters on input