Sprachauswahl: Deutsch / English

Brainfuck interpreter in Malbolge Unshackled

Diese Seite ist leider nur auf Englisch verfügbar.

Logo of the brainfuck interpreter in Malbolge Unshackled: A Malebranche skewering a human brain

Here you can download my brainfuck interpreter written in Malbolge Unshackled (227 kiB). The size of the interpreter is about 2MiB, so I put it into a zip file.

Usage

Input: <brainfuck program>!<input for brainfuck program>
alternatively: <brainfuck program><EOF><input for brainfuck program>

The brainfuck dialect is as follows:

  • There are infinite many memory cells (to the right) that can hold arbitrary large (or small) numbers.
  • At the first memory cell, the command < is ignored.
  • On input, a newline is converted to \10. EOF is converted to \0.
  • If the value of the current memory cell is negative, the output command is simply ignored.
  • On output, a Unicode character is printed.

The HeLL source is available here and can be assembled with LMFAO. Thus, you can check its correctness, proving Malbolge Unshackled to be Turing complete.

Examples

On my Intel Core i7, the reference interpreter needs a few minutes for the examples below (and 1.5 GiB of RAM). I recommend to use my Malbolge Unshackled interpreter instead, which is approximately 4–9 times faster compared to the reference interpreter. You may even want to use my non-standard-compliant Malbolge Unshackled interpreter, which is a lot faster.

Example 1

Input:  ++++++++[>++++++++++++<-]>++.++++.!
Output: bf

Example 2

Input:  ,[.,]!bf
Output: bf

Example 3

Input:  >,[>,]<[.<]!fb
Output: bf

Example 4

This example comes from Esolangs and needs about 15 minutes with the Malbolge Unshackled reference interpreter at my hardware (depending on the random decisions of the interpreter). It needs only about 2 minutes with my Malbolge Unshackled interpreter.

Input:  >++++++++[-<+++++++++>]<.>>+>-[+]++>++>+++[>[->+++<<+++>]<<]>-----.>->+++..+++.>-.<<+[>[+>+]>>]<--------------.>>.+++.------.--------.>+.>+.!
Output: Hello World!\n