To input glyphs, you can either use the language bar, or the prefix key, which is . The keyboard layout is shown in the image below. To input a glyph in the middle column, press the prefix key once and then the corresponding key (shown in the first column), holding Shift if it's in the upper row. To input a glyph in the last column, press the prefix key twice and then the corresponding key, shifing as before. Note that many (probably most) available glyphs currently correspond to no behavior and will error when ran.
To run your code, you can press Enter or the Run button. To edit code you already ran, click on it. Similarly, you can click on an output to put it into the input bar. You can also scroll through previously ran code with Shift+↑ and Shift+↓. To insert a newline in the code, you can press Shift+Enter.
In addition to all the quad names available normally in TinyAPL, there are additional ones:
⎕Debug: acts exactly like
⊢, except the input(s) are printed to the JavaScript console. Useful if you want to create your own quads and want to look at the JS structure of arrays.
id←⎕CreateImage size: adds a blank image of size
size, which can either be a scalar number (creating a square image) or a vector of
⟨height⋄width⟩. Returns an
id(which is currently a number, but it's an implementation detail) which can be used to update the image display.
[id] ⎕DisplayImage data: renders an image, either to a new display or to the one indicated by
id.
datashould be a real array of rank
2or
3(if it's of rank
2a trailing unit axis is introduced as in
∧⍤0 data) and the last axis must be of length
1,
2,
3,
4. If the last axis has length
1,
datais interpreted as grayscale; if it has length
2, it is interpreted as grayscale + alpha, if it has length
3, it is interpreted as RGB, if it has length
4, it is interpreted as RGBA. In all cases,
0is the lowest value of the channel and
1is the highest value in the channel. All data outside this range is clamped.
[delay] ⎕PlayAnimation data: plays an animation.
datashould be a real array of rank
3or
4. Each major cell of
datais used as a frame for the animation, in the way described for
⎕DisplayImage.
delayis the delay between frames in seconds and defaults to
0.1.
[mode] ⎕ScatterPlot data: renders a plot.
datashould be a real array of rank
2or
3(if it's of rank
2a leading unit axis is introduce as in
∧data) and the last axis must be of length
2. Matrices of
dataare interpreted as scatter plot datasets, with each vector of the matrix being a
⟨x⋄y⟩pair. If
modeis provided, it must be one of
"markers", which is the default and displays dots;
"lines", which connects the provided points (and attempts to do so smoothly);
"lines+markers", which displays both.
[start] fns ⎕_Graph end: graphs functions.
fnsshould be a function, a vector of functions, or a vector of pairs of functions and labels. The default labels are the representations of the functions.
startand
endare the start and end of the graph, respectively. The default
startis
0. The function is evaluated at
501points evenly spaced between
startand
end.
[sampleRate] ⎕PlayAudio data: plays audio.
datashould be a real array of rank
1or
2(if it's of rank
1a leading unit axis is introduced as in
∧data). Vectors of
dataare channels containing samples.
sampleRateis the sample rate of
dataand defaults to
44100.
data←[type] ⎕Fetch url: fetches data from the web.
urlmust be a string. If
typeis not provided,
urlis fetched and
datais the text content of the result. If
typeis provided,
urlis fetched as binary and it is interpreted according to
type:
1: bits
8: unsigned 8-bit
¯8: signed 8-bit
16: unsigned 16-bit little endian
¯16: signed 16-bit little endian
0ᴊ16: unsigned 16-bit big endian
0ᴊ¯16: signed 16-bit big endian
32: unsigned 32-bit little endian
¯32: signed 32-bit little endian
0ᴊ32: unsigned 32-bit big endian
0ᴊ¯32: signed 32-bit big-endian
0.32: 32-bit float little endian
0ᴊ0.32: 32-bit float big endian
0.64: 64-bit float little endian
0ᴊ0.64: 64-bit float big endian
⎕last,
⎕Last,
⎕_Last,
⎕_Last_: access the result of the last successful code ran.