This repository has been archived by the owner on Nov 12, 2020. It is now read-only.
Quick reference
Rodrigo Girão Serrão edited this page Jul 1, 2020
·
5 revisions
Operator | Hex | Words in a line* | Line modifier** | Short description |
---|---|---|---|---|
« |
00 | 0 | - | moves pointer to the left edge of the tape |
» |
01 | 1 | - | moves pointer to the right edge of the tape |
> |
02 | 2 | - | moves pointer one cell to the right (extends tape if needed) |
≥ |
12 | 2 | 2lc |
skip non-zero block to the right (extends tape if needed), same as [>]
|
< |
03 | 3 | - | moves pointer one cell to the left (extends tape if needed) |
≤ |
13 | 3 | 2lc |
skip non-zero block to the left (extends tape if needed), same as [<]
|
+ |
04 | 4 | - | increments current cell by 1 (wraps at max cell size) |
± |
14 | 4 | 2lc |
increments current cell by 1 only if it doesn't make it wrap to 0
|
- |
05 | 5 | - | decrements current cell by 1 (wraps at max cell size) |
∓ |
15 | 5 | 2lc |
decrements current cell by 1 if cell is already not 0 ¹
|
, |
06 | 6 | - | reads one character from input |
; |
16 | 6 | 2lc |
reads the whole input, same as ,[>,]
|
. |
07 | 7 | - | writes one character to output |
: |
17 | 7 | 2lc |
writes a sequence of non-zero cells to output, same as [.>]
|
[ |
08 | 8 | - | enters [] if current cell is not zero (akin to a while loop) |
] |
09 | 9 | - | moves code execution to matching [
|
( |
0a | 10 | - | enters () if current cell is not zero (akin to an if statement) |
) |
0b | 11 | - | signals the end of the matching ( code |
* for brainetry, a "word" is any sequence of characters that is not a space (ASCII code 32
).
** 2lc
means double last character, i.e. the last two characters of the line must be the same.
¹ if cell wrapping is disabled (i.e. the CLI -w 0
option is used) then ∓
used on a cell with value v
sets the cell to max(0, v-1)
, meaning a cell with a value of 0
or below will become 0
and all other cells are decremented as usual.