esolang

Undecimal

Brainfuck as a single number in base 11, where a space is the digit ten.

None1, 2023 · Turing complete: with unbounded memory · ●○○ easy · esolangs.org

Tested with 2 known programs · Test method

Run it

Expected: hi

The idea

None1 made Undecimal in 2023, after Duocentehexaquinquagesimal, Golunar and Unary. Unary writes a brainfuck program as a count of zeros, and the languages after it write that count as a number in some base. Undecimal uses base 11, and its eleventh digit is a space. So a program is a row of digits with gaps in it, and every gap counts.

The machine

  1. Read the digits 0 to 9 and the space as one number in base 11. Anything else is skipped.
  2. Write that number in octal.
  3. Each octal digit is a brainfuck command. Drop the first, which is always the marker 1.
Octal01234567
Brainfuck><+-.,[]

The brainfuck then runs on 30,000 cells of one byte each that wrap, with 0 at the end of the input.

Example

The cat is ,[.,], the number 56,623, and that is 395 6 in base 11.

The cat is ,[.,], the number 56,623, and that is 395 6 in base 11. The space is the digit ten.

The Hello World is 63 base-11 digits. Inside is a 72 command brainfuck program that needs cells that wrap.

Expected: Hello, World!

The specification gives 0 as the one-time cat ,., but 0 is 110, which its own compiler reads as ,[, an open loop. The number for ,. is 108, which is 99.

Expected: x

Patterns it teaches

Further

Undecimal builds on Brainfuck.

Zero-dimensional languages

Brainfuck equivalents

Write your own in Run Convert a program from Undecimal

Implementation

JavaScript interpreter, source and command line

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

Command line

shib run undecimal -e '395 6' --input 'cat'
shib manual undecimal

Source

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

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

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