12345678
Brainfuck counted out in Chinese, one to eight.
None1, 2024 · Turing complete: yes · ●○○ easy · esolangs.org
Tested with 2 known programs · Test method
Run it
The idea
None1 made 12345678 in 2024, after noticing that he had not made many Chinese brainfuck equivalents. Each of brainfuck's eight commands is a Chinese numeral, in the order +-<>,.[], so the commands are numbered one to eight.
Read the story
The specification's interpreter in Python keeps a million cells that wrap at 256. A negative cell index reads the tape from its far end, as a Python list does. Every character that is not one of the eight numerals is a comment.
The machine
| Numeral | Number | Brainfuck | Does |
|---|---|---|---|
一 | 1 | + | Add one to the cell |
二 | 2 | - | Take one from the cell |
三 | 3 | < | Move left |
四 | 4 | > | Move right |
五 | 5 | , | Read a character, 0 at the end of input |
六 | 6 | . | Print the cell |
七 | 7 | [ | Jump past the matching 八 if the cell is 0 |
八 | 8 | ] | Jump back to the matching 七 if it is not |
Example
The cat reads a character, then prints it and reads the next one until the input runs out.
The cat reads a character, then prints it and reads the next one until the input runs out.
The Hello World is the well known brainfuck one, and the space in its middle is a comment.
The specification also has a program that prints the Kolakoski sequence without end, 1, 2, 2, 1, 1, 2, 1 and on. It also runs, until the step limit is spent.
Patterns it teaches
- Turing tarpit: brainfuck under another alphabet.
Further
See also
12345678 builds on Brainfuck.
CJK
Brainfuck equivalents
Write your own in Run Convert a program from 12345678
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: 12345678.
Command line
shib run 12345678 -e '五七六五八' --input 'abc'shib manual 12345678Source
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/12345678.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org