booleanFunge

From Esolang
Jump to navigation Jump to search
BooleanFunge
Designed by User:KapitanGamer
Appeared in 2023
Memory system Stack with booleans
Computational class Push-down automata
Reference implementation Unimplemented
File extension(s) .boolfunge

BooleanFunge is a fungeoid based on boolean values. Has 2D program and stores data in stack with booleans.

The program is not stopped by borders - after crossing the border of the program, the pointer appears on the other side.

Data types

Boolean

The most basic type. It has only two values ​​- true and false. It can easily be treated as a bit - 0 is false, 1 is true.

Stack

The stack is a data structure with two operations - push and pop. A push operation is to push an element to the top of the stack. Pop is to get an item from the top of the stack. In BooleanFunge, the only stack holds booleans.

Stack part

A data structure that is a slice of the stack. When pushing a stack part to the stack, the stack part "sticks" to the top of the stack. When n items are popped from a stack, all populated items merge into a stack part. This interesting structure can also be used in other esolangs.

Char

Char is a number from 0 to 127 that is a sequence of eight booleans. It can be represented as an ASCII character, which allows interaction with the user.

Commands

> Go right and push true into the stack.
< Go left and push false into the stack.
v Go down and push random boolean into the stack.
^ If stack hasn't any value, turn into <. Else, if the stack has only one value turn into >. Else, go up and pop two values from the stack.
# Pop value from stack. If this value is true, go right. Else, go left.
& If the stack hasn't eight values, turn into $. Else, pop eight values from the stack, convert this stack part into the char and write it in output.
$ Read char from input, convert resulting char into stack part and push it into the stack.
@ End program, if stack has any true values.

Examples

Example programs may not work.

Write H

<v<
  >vv <
 v ^vv ^v<
 >>^> >^v^>vv <
     >>  ^^vv ^v<
        >>^> >^v^v<  >@
            > > ^v^v<&
               >> ^v^
                 >> ^^
                   >>^

One Time Cat

$&>@

Infinity loop (without stack clogging)

>v
^v
^<

Truth machine ("if ascii code of input is even" version; with stack clogging)

$v       v                   <
v  #     v v<
vv ^v<   v v^v<
 >>^v^v< >> ^v^v<
>>   ^v^v< >> ^v^v<
    >> ^v^v< >> ^v^v<
      >> ^v^v< >> ^v^ v<
        >> ^v^v< >> ^ v^v<
          >> ^v^v< >> ^v^>&>>^
            >> ^v^v<>@>> ^^
              >> ^v^&   >>^
                >> ^^
                  >>^

Write random char

v
v
v
v
v
v
v
v
&
>@

Coming soon