esolang

Brainfuck+10

Brainfuck with ten more commands, five of which jump straight to a character.

Watermelyn, 2022 · Turing complete: yes · ●○○ easy · esolangs.org

Tested with 2 known programs · Test method

Run it

Expected: Hello World!

The idea

Watermelyn made Brainfuck+10 in 2022 and named it after Brainfuck+3. It keeps brainfuck's eight commands and adds ten. Five of them set the cell to a fixed character code, for A, a, Z, z and the digit 5, so a letter is only a few + or - away. The other five are comments, exit, reset, and numbers in and out.

Read the story

The specification gives the language as a short Python script, and this implementation does what the script does. Input comes a line at a time, so , takes the first character of a line. + wraps one step early, from 254 to 0, and - takes 0 to 255.

The machine

CommandDoes
> < + - . , [ ]As in brainfuck
$Start or end a comment
eExit
rSet the cell to 0
A a Z z 5Set the cell to 65, 97, 90, 122 or 53
#Print the cell as a number
/Read a number into the cell, held between 0 and 255

The tape starts with one cell and grows to the right only. Moving left of the first cell is an error.

Example

Hello World starts each letter from the nearest fixed code.
Expected: 0
Expected: hy

Hello World starts each letter from the nearest fixed code. 5 is 53, and 21 - take it down to 32, a space.

The truth machine reads a number. On 0 it skips the loop and prints 0 once. On 1 it prints 1 forever.

Each , reads a whole line and keeps its first character, so the last one prints h and y.

Patterns it teaches

  • Turing tarpit: brainfuck with shortcuts that change nothing about its power.

Further

Brainfuck+10 builds on Brainfuck.

Brainfuck derivatives

Cell-based

Write your own in Run Convert a program from Brainfuck+10

Implementation

JavaScript interpreter, source and command line

A JavaScript interpreter, used in the browser and on the command line. Id: brainfuck-10.

Command line

shib run brainfuck-10 -e '/[#]#' --input '0'
shib manual brainfuck-10

Source

Module
langs/wiki/ports.js
Interpreter
langs/wiki/brainfuck-10.js

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

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