Malbrain

From Esolang
Jump to navigation Jump to search

Malbrain is an esoteric programming language with only 2 commands: > and .. Due to the design, it is also extremely hard to maintain, since each command is relative to the previous.

Malbrain is translated to brainfuck before it is executed and so is computationally equivalent to brainfuck. This is NOT the same as a turning tarpit.

Commands

The commands are:

Token Action
> Next command
. Use command

The command number starts at 0 at the beginning, which is >. The output commands, their arrangement, and internections, are as follows:

Number Current brainfuck command Next brainfuck command
0 > <
1 < +
2 + -
3 - .
4 . ,
5 , [
6 [ ]
7 ] >

Like brainfuck, all non commands are considered comments. If the command goes past the list, it restarts to 0.

Examples

Hello World!

This is the brainfuck hello world converted to malbrain

.>>.........>>>>.>>>.>........>>>>>>.>>>.>>>>.>>.>>>.>>>>.
>>.......>>>>.>>>.>....>>>>>>.>>>.>>>>.>>.>.>>.>>>>>>.......
>>..>>>>>>...>>.>>>>...>>........>>>>.>>>.>....>>>>>>.>>>.>>>>.
>>.>>>.>>>>...>>..........>>>>.>>>.>.........>>>>>>.>>>.>>>>.>>.
>>...>.>>>>>....>>>.>>>>>>...>>.>>>>>>>......>.>>>>>>>........>.
>>>>..>>.>>.

Cat program

This is malbrain cat (No change on EOF)

>>>>>.>.>>>>>>.>>.>>>>>.>>>>.>>>>>>.>>.

Truth-machine

A truth-machine is operated in this example:

>>>>>.>>>>>>>.>>.>>>>>..>>>>>.>>.>>>>.>>..>>>>>>>.>>.>>>>>.>>>>>>.>>>.>>..>>>>>>.

External resources

See also