esolang

Brainalpha

Brainfuck where every cell holds a capital letter, so the alphabet needs no ASCII table.

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

Tested with 2 known programs · Test method

Run it

Expected: HI

The idea

None1 made Brainalpha in 2024. It is brainfuck with each of the eight commands renamed to a letter from A to H, and with cells that hold only the 26 capital letters. Every cell starts as A, stepping past Z gives A again, and stepping back from A gives Z. Printing a cell prints its letter.

Read the story

The point is that a Caesar shift becomes easy. There is no 65 to subtract and no 26 to take the modulo of, because the cells already wrap around the alphabet.

The machine

LetterBrainfuckDoes
A>Move the pointer right
B<Move the pointer left
C+Step the cell to the next letter
D-Step the cell to the letter before
E.Print the cell's letter
F,Read a character into the cell
G[Jump past the matching H if the cell is A
H]Jump back to the matching G

F keeps the cell as it is when the character is not a capital letter, and at the end of the input. The cat and Caesar shift therefore never stop.

Example

Seven steps from A reach H, and one more reaches I.

Seven steps from A reach H, and one more reaches I.

Expected: HELLOWORLD

The Hello World program has no comma, space or small letters, because the cells hold none. The alphabet takes a counter that starts at Z, one step back from A. The loop prints and steps the letter in the next cell 25 times, and the last AE prints Z.

Expected: ABCDEFGHIJKLMNOPQRSTUVWXYZ

Patterns it teaches

  • Turing tarpit: the eight commands of brainfuck, with a smaller cell.

Further

Brainalpha builds on Brainfuck.

Brainfuck equivalents

Write your own in Run Convert a program from Brainalpha

Implementation

JavaScript interpreter, source and command line

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

Command line

shib run brainalpha -e 'CCCCCCCECE'
shib manual brainalpha

Source

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

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

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