esolang

掉爆子脑

Brainfuck in eight Chinese characters, each one swapped for its opposite.

PSTF, 2024 · Turing complete: yes · ●○○ easy · esolangs.org

Tested with 2 known programs · Test method

Run it

Expected: cat

The idea

PSTF made 掉爆子脑 in 2024 as the reverse of 脑子爆掉, a brainfuck written in Chinese characters. The name is 脑子爆掉 read backwards, and every command is the opposite word of the one in 脑子爆掉. Right stands for left, down for up, write for read and end for start. So 左, left, moves the pointer right, and 终, end, opens a loop.

The machine

CharacterMeansBrainfuck
右right<
左left>
下down+
上up-
写write,
读read.
终end[
始start]

This implementation runs it as the Python interpreter on the specification does. The tape has 1,000,000 byte cells that wrap, and as in Python a move left of the first cell reaches the last ones. 写 gives 0 at the end of the input. The Python reads the program from standard input, which leaves no input for 写, so this implementation keeps the program and its input apart.

Example

The first is the cat, ,[.,], which reads as write, end, read, write, start.
Expected: A

The first is the cat, ,[.,], which reads as write, end, read, write, start. The second is the brainfuck ++++++++[>++++++++<-]>+. put through the table. It multiplies 8 by 8, adds 1 and prints 65.

Patterns it teaches

Further

掉爆子脑 builds on Brainfuck.

CJK

Brainfuck equivalents

Write your own in Run Convert a program from 掉爆子脑

Implementation

JavaScript interpreter, source and command line

A JavaScript interpreter, used in the browser and on the command line. Id: u6389-7206-5b50-8111.

Command line

shib run u6389-7206-5b50-8111 -e '写终读写始' --input 'hi'
shib manual u6389-7206-5b50-8111

Source

Module
langs/wiki/ports.js
Interpreter
langs/wiki/u6389-7206-5b50-8111.js

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

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