esolang

Numberwang

Brainfuck written in digits, so that a program looks like a long random number.

2011 · Turing complete: yes · ●○○ easy · esolangs.org

Tested with 4 known programs · Hello World on Try It Online: identical · Test method

Run it

Expected: Hello, World!

The idea

Numberwang takes the eight brainfuck commands and gives each a digit. The two digits left over, 6 and 5, take the next digit as an amount to add or subtract. A run of nine + becomes 69, and the code looks even more like noise.

The machine

A tape of byte cells that wrap at 256, growing both ways, and a pointer.

DigitDoes
1 0> <
9 2+ -
3.
8,
4 7[ ]
6dAdd the digit d to the cell
5dSubtract the digit d from the cell

Every other character is a comment. The specification lists 0 and 1 the other way round in one place; on a tape that grows both ways both readings print the same. Reading past the end of the input gives 0.

Example

The first program adds 9 eight times to reach 72, H, then nudges the same cell from letter to letter.
Expected: 3

The first program adds 9 eight times to reach 72, H, then nudges the same cell from letter to letter. The second reads a digit, adds 2 and prints it.

Patterns it teaches

  • Camouflage: brainfuck that hides in a string of digits.

Further

Cell-based

Write your own in Run Convert a program from Numberwang

Implementation

JavaScript interpreter, source and command line

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

Command line

shib run numberwang -e '8383' --input 'ab'
shib manual numberwang

Source

Module
langs/tio/ports.js
Interpreter
langs/tio/numberwang.js

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

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