BooleanFunge

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

BooleanFunge is a fungeoid created by User:TenBillionPlusOne. It's 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.

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 and write it in output as a character.
$ Read char from input and push its bits 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

$&>@

Infinite loop

>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
&
>@