esolang

ParrBF

Brainfuck with no pointer. The column a command stands in is the cell it works on.

Benni++, 2009 · Turing complete: unknown · ●●○ moderate · esolangs.org

Tested with 2 known programs · Test method

Run it

Expected: 35

The idea

Benni++ made ParrBF in 2009 and calls it a joke language. It has brainfuck's commands except < and >. Every column of the program is a variable, so to work on the third variable a command is written in the third column. Programs run row by row, and a row of commands touches several variables side by side, like parallel tracks.

Read the story

A loop can start in one column and end in another. The [ tests its own column and the ] tests its own, so a loop runs while both are not 0. The specification uses that for a minimum of two numbers.

The machine

CharDoes
+ -Add or take 1 from this column's variable
. ,Print it as a character; read a character into it
~Print it as a decimal number
[Jump behind the matching ] if this column is 0
]Jump back to the matching [ if this column is not 0

Variables are bytes that wrap. The end of input reads as 0. Every other character is a comment.

Example

The way to set the first variable to 3 and the second to 5, with a row that prints both.

The way to set the first variable to 3 and the second to 5, with a row that prints both.

The min. Column 1 counts 7 rounds that each add 7 to column 2, and the 1 taken after the loop leaves 48, the code of 0. Then the values 8 and 5 go in columns 0 and 1, and a loop from column 0 to column 1 takes 1 from both and adds 1 to column 2 until one of them is 0.

Expected: 5

The Hello World. The letters on the eighth row say which column holds which character. Column 0 counts 8 rounds of the big block, a few rows put each value right, and the last four rows print the columns in the order the text needs.

Expected: Hello World!

Patterns it teaches

  • Turing tarpit: brainfuck with the pointer moves taken out and the layout of the program put in their place.

Further

Cell-based

Write your own in Run Convert a program from ParrBF

Implementation

JavaScript interpreter, source and command line

A JavaScript interpreter, used in the browser and on the command line. Id: parrbf.

Command line

shib run parrbf -e ' +
 +
 +
 +
 +
 +
 +
 [+
 -+
  +
  +
  +
  +
  +
 ]-
The two values (8 & 5):
++
++
++
++
++
+
+
+
Execute min:
[
--+
 ].'
shib manual parrbf

Source

Module
langs/wiki/ports.js
Interpreter
langs/wiki/parrbf.js

Docs: Kernel instructions · The .shib format · Command line · Adding a language

Source esolangs.org (CC0) · Edit on esolangs.org