| Category | Keywords | Description |
|---|---|---|
| Control Flow | if, else, while, stop | Conditional branching and execution bounds |
| Instruction Pointer | jump, next | Restarts the top of an each/while loop (jump) or exits it (next) |
| Variables & Storage | make, del, take, open, save, download | Declares, deletes, reads input into, or exports local data. take x reads input; inside a class, take.method() calls the parent's method. open is an alias of take. make b a copies a number or text, but a list, dictionary or object is shared: change b and you've changed a |
| Names & Types | a / an, as, with | make rex a Dog with "Rex", "Husky" creates an object named rex (a/an only counts before a class name; make a Dog with no name calls the variable dog). x as v gives a value a second name. When the word after as is a type, it converts instead: take x as number, make n text as int, total as string (types: string, number, int, float, bool, list, dict). with lists parameters: define add with a, b, class Dog with breed. with is only for these declaration lines. Calls use parentheses: add(2, 3), name.replace("a", "b"), and a call with no arguments needs none: answer, rex.speak, name.upper |
| Functions & OOP | define, give, class | Functions, returns and classes. Declarations use with (define add with a, b); calls use parentheses (add(2, 3)), so the two look different on the page. Parameters come after with, and a class's header params become its fields: class Dog with breed extends Animal (extends names the parent). There is no init: any line in a class body that is not a define is setup code that runs when an object is made (the parent's first), e.g. make self.shout label.upper() |
| Output & Speech | print, say | Console printing and browser SpeechSynthesis output |
| Comments | note | Comment: everything after note to the end of the line is ignored |
| Visual Anchors | pin | Zero-cost visual canvas anchor node |
| Math & Text | +, -, *, /, //, %, ^ | Arithmetic. // divides and rounds down (7 // 2 is 3, -7 // 2 is -4), % is the remainder, ^ is power. + also joins text, and turns the other side into text: "Total: " + 5, "ok: " + yes |
| Data & Logic | each, in, yes, no, none, is, same, mostly, not, and, or | Iteration (each 3, each n in items), boolean literals, equality, list mostly yes (true when more than half the list matches; a tie is no), and logical operators |
| Screen & Events | #name, bind, on, every | Every #name in a program is an element on the Screen (above the console), made when the program starts. A name ending in -btn is a button, -input a text box, -canvas a drawing area; otherwise it's decided by use (clicked or given a label: button, given a value or typed into with on type/on enter: text box, drawn on: canvas, else a label). bind #app.text counter keeps #app showing counter as it changes. make #title.text "Hi" sets it once. #user-input.text reads what's typed in a box. on click "#submit-btn" runs the indented lines on each click (also on type, on change, on enter, on hover, and on key for the keyboard, which gives you key). every 1 second repeats its lines (ms, seconds, minutes). A program with on or every keeps running until you press Stop. Properties: text, color, background, size, visible, width, height. Canvas: #pad-canvas.circle(x, y, r, "red"), .rect(x, y, w, h, color), .line(x1, y1, x2, y2, color), .write(x, y, "text", color), .clear. A trailing then on a block's first line and an ok line after a block are allowed, but the indentation is what counts |
| Packages | use | Brings in code from elsewhere. use python numpy as np loads a Python package (the standard library, packages like numpy and pandas, or pure-Python packages from PyPI; the first Python import takes a few seconds). use js lodash as lo loads a JavaScript package from npm. use "https://example.com/tools.vx" runs a Mutter file and gives you its functions (add as tools to keep them under tools.). With no as, the name is the package's: use js date-fns gives date_fns. Package functions use the normal call syntax: np.mean([1, 2, 3]), df["age"].max(). If the install name differs from the import name, use the install name: use python python-slugify as slugify. Only use packages you trust: they run with the same access as this page |
| Error Handling | try, catch | Exception blocks and exception variable binding |
| Timing & Automation | wait, every, from | Execution delays and event triggers |
| Loop Variables | i, ii, j, jj, k, kk | Automatic names inside each. In the outer loop i is the item (or the count) and ii is its position (or, over a dictionary, i is the key and ii the value). A loop inside it uses j/jj, and one inside that uses k/kk |
Put a dot after any text and name what you want done. They chain left to right: name.trim.title.replace(" ", "_"). A text method never changes the original; it gives back new text. A method with nothing to pass needs no parentheses: name.upper, name.length.
| Method | Does | Example |
|---|---|---|
upper / lower | Changes the case | "hi".upper → "HI" |
title / capitalize | Capitalizes every word / just the first letter | "ada lovelace".title → "Ada Lovelace" |
trim | Removes spaces from both ends | " hi ".trim → "hi" |
split(sep) | Cuts text into a list | "a,b".split(",") → ["a", "b"] |
words / lines | Splits on spaces / on line breaks | "to be or".words → ["to", "be", "or"] |
replace(old, new) | Replaces every match | "banana".replace("a", "o") → "bonono" |
contains(x) / starts(x) / ends(x) | Yes or no questions about the text | "hello".starts("he") → yes |
count(x) | How many times x appears | "banana".count("a") → 3 |
index(x) | Position of x (counting from 0), or none | "hello".index("l") → 2 |
length | Number of characters | "hello".length → 5 |
reverse | Backwards | "abc".reverse → "cba" |
repeat(n) | Repeats the text n times | "ab".repeat(3) → "ababab" |
pad(width, fill) / padend(width, fill) | Pads on the left / right (fill defaults to a space) | "7".pad(3, "0") → "007" |
chars | One item per character | "hi".chars → ["h", "i"] |
isEmpty | Yes if there is nothing in it | "".isEmpty → yes |
Lists answer to the same dot calls. mostly asks a list a question too: votes mostly yes.
| Method | Does | Example |
|---|---|---|
join(sep) | Glues items into text | ["a", "b"].join("-") → "a-b" |
sort / sort("desc") | Sorted copy (numbers by value, text alphabetically) | [3, 1, 2].sort → [1, 2, 3] |
reverse | Backwards copy | [1, 2, 3].reverse → [3, 2, 1] |
unique | Removes repeats | [1, 2, 2].unique → [1, 2] |
first / last | The first / last item (none if empty) | [4, 5, 6].last → 6 |
count(x) | How many items equal x | [1, 2, 2].count(2) → 2 |
sum | Adds up the numbers | [1, 2, 3].sum → 6 |
length / isEmpty | How many items / is it empty | [1, 2].length → 2 |
push(x) | Adds x to the end | [1, 2].push(9) → [1, 2, 9] |
A dictionary answers to these, and to d.key or d["key"] for its values. If it has a key with the same name as a method, the key wins: {"keys": 1}.keys is 1.
| Method | Does | Example |
|---|---|---|
keys / values | A list of the keys / the values | {"a": 1, "b": 2}.keys → ["a", "b"] |
length / isEmpty | How many keys / is it empty | {"a": 1}.length → 1 |
has(key) | Yes if the key is there | person.has("age") → yes |
The only functions you can call without defining them. Everything else is a method (s.upper) or a conversion with as (x as int).
| Function | Does | Example |
|---|---|---|
random / random(n) / random(a, b) | A decimal from 0 to 1 / 0 to n / a to b | random(20, 380) → 147.3... |
randint(a, b) | A whole number from a to b, both included | randint(1, 6) → 4 |
pick(list) | One item at random | pick(["red", "blue"]) → "blue" |
min / max | Smallest / largest of a list or of several numbers | max(3, 9, 4) → 9 |
abs / round / floor / ceil / sqrt | Number tools | round(2.6) → 3 |
pi / sin / cos / tan / atan2 | For angles and drawing (radians) | cos(pi) → -1 |
range(n) / range(a, b) | Whole numbers from 0 (or a) up to, not including, n (or b) | range(2, 5) → [2, 3, 4] |
now / time / type(x) | Today's date / the time / what kind of value x is | type(3) → "int" |
Tap the mic and talk. Your words appear in the editor as you speak, using your browser's built-in speech recognition. A few words work as voice commands and type something other than themselves. Typing by hand always works normally.
| Say | Does |
|---|---|
then | New line, one indent level deeper (starts a block) |
so | New line at the same indent level |
ok | New line, one indent level back out (ends a block) |
back | Deletes the last word |
comma | , -- between arguments: tag pad dot circle 10 comma 20 comma 5 pair types #pad.circle(10, 20, 5) |
tag app | #app -- a Screen element. tag app dot text types #app.text, and on click tag submit then types on click #submit and starts the block. One-word names are easiest to say |
it | Types the last name you mentioned, including its dotted part: after p dot x, it types p.x, so make p dot x plus it types make p.x + p.x |
run | Presses the Run button |
line five | Moves the cursor to line 5 (a spoken number or a digit both work) |
| Say | Types |
|---|---|
par | ( |
index | [ |
curl | { |
pair | Closes the innermost open bracket: ), ] or } to match what is open (plain ) if none is) |
a function name (made with define) | name( -- say pair to close it |
dot name | .name -- a field or a method with no arguments (p dot x, name dot upper). For methods that take arguments (replace, split, push, join, canvas drawing, your own methods defined with parameters) it types .name(; close it with pair |
the name right after define | Typed as a plain name -- say with and the parameter names after it. Later calls to it get name( |
| Say | Types |
|---|---|
is / equals | = |
not equals / does not equal | != |
more | > |
less | < |
plus | + |
minus | - |
times / multiplied by | * |
divided by | / |
mod / modulo | % |
power | ^ |
| Say | Types |
|---|---|
spoken numbers: five, twenty three, two thousand six, a hundred and five | the digits: 5, 23, 2006, 105 |
quote ... quote | Everything in between becomes one "double-quoted string", even words that are normally commands. back still deletes, and so / then / ok close the string and start the new line |
I (the letter, which the browser hears as the pronoun), jay, kay | i, j, k -- the automatic loop names |
Speech recognition reaches for common English words, so these are fixed for you:
| Heard | Becomes |
|---|---|
than | then |
sew, sow | so |
okay | ok |
pear, pare, pairs | pair |
knot | not |
eye, aye, I | i |
jay | j |
kay | k |
too | 2 -- always the digit, even inside quotes |
| You say | You get |
|---|---|
define double with put then | define double with put and a new line indented one level |
give put times two ok | give put * 2 and a new line back out one level |
print double five pair | print double(5) |
name dot upper | name.upper -- dot glues to the word before it; a method with no arguments needs no parentheses |
items dot push 3 pair | items.push(3) |
take dot speak pair | take.speak(), the parent call |
index zero pair | [0] |
make x quote hello world quote so | make x "hello world" and a new line |
each ten then print I | each 10, then print i indented under it |
run, line, pair, par, curl, index, back, it, dot, quote, tag, comma, the operator words, and spoken numbers are reserved while dictating. If a variable of yours has one of those names, it gets swallowed as the command, so type that name by hand or wrap it in quote ... quote.
par and pair sound alike in fast speech but are deliberately not cross-corrected: they are the open and close.
The the <request> AI helper is switched off in this build. The corrections above cover the words Vertex's own commands collide with; if the browser keeps mishearing a keyword such as define, type it.