brainstack(islptng)

From Esolang
Jump to navigation Jump to search

Brainstack is not a brainfuck derivative, but a completely new language.

Instead of cells, we operate on stacks. The pointer itself has also got a box.
Elements can be any integer, unbounded. The stack tape is unbounded, too.

Commands

Command Meaning
> Pointer move right
< Pointer move left
(123) Set the box to that number
_ Push the box to the stack
^ Pop the stack to the box
+ Increment TOS by the box
- Negate the box
[ ... ] Unconditional infinite loop
? ... * ... ! If-Else block. Condition: box is zero. Else (*) is mandatory.
, . Get user in/output in character, stored in the box.
; : Get user in/output in number, stored in the box.
# Break
@ Continue

Examples

FizzBuzz

_>(1)_>(4)_>(2)_
[^?(2)_(70).(105).(122)..<<<^(1)_>>*_(1)-+<!
^?(4)_(66).(117).(122)..<<^(1)_*_(1)-+<<!
^?_>^:_*(0)_>(10).!(1)+>>]

See also