Brain Online Visualizer does not perform any optimization on the interpreted code. If you want to run it faster, please visit the Brain Compiler project: https://github.com/brain-labs/brain
> |
increment the data pointer (to point to the next cell to the right). |
< |
decrement the data pointer (to point to the next cell to the left). |
+ |
increment (increase by one) the byte at the data pointer. |
- |
decrement (decrease by one) the byte at the data pointer. |
* |
multiply *ptr with *(ptr-1) . Store result in *ptr // format: 2 3 * |
/ |
divide *ptr with *(ptr-1) . Store result in *ptr // format: 2 3 / |
% |
divide *ptr with *(ptr-1) . Store the remainder in *ptr // format: 2 3 % |
. |
output the byte at the data pointer. |
$ |
prints out the value at the data pointer divided by 100. |
# |
prints out the current debug information. |
, |
accept one byte of input, storing its value in the byte at the data pointer. |
[ |
a.k.a (while loop) .If the value at the data pointer is zero, then instead of moving the instruction pointer forward to the next command, jump it forward to the command after the matching ] command. |
] |
jump to its correspondent [ . |
{ |
a.k.a (for loop) . Iterates 'value-at-the-data-pointer' times and needs to be closed with a matching } command. It does not decrease the value at the data pointer. It will only work for positive values greather than zero. |
} |
jump to its correspondent { . |
! |
a.k.a break . jumps to the end of a loop ([ ] or { } ) . |
? |
a.k.a if . if the value at the data pointer is zero, jumps to the block with : or ; and executes the commands one by one up to its correlative ; , otherwise, it executes the code until it finds a : or ; . |
: |
a.k.a else . it works as an otherwise for ? . |
; |
ends a ? or : statement. |
More information on: https://github.com/brain-labs/brain