esolang

ABCD

One cell and four letters. A goes up, B goes down, C reads, D prints, and nothing ever repeats.

Billlam, 2011 · Turing complete: no · ●○○ easy · esolangs.org

Tested with 3 known programs · Test method

Run it

Expected: Hello, World!

The idea

Billlam made ABCD in 2011 and calls it unusable for programming and totally Turing incomplete. There is one cell and no loop, so a program does each of its commands once, in order. To print a text the program counts the cell up or down to each character in turn. The Hello World is 390 letters long, and its cat is CD written out once for every character it may ever read.

Read the story

The specification gives an interpreter in C#, which can also write programs. Given a text, it prints the A or B that take the cell from one character to the next, and a D after each.

The machine

LetterDoes
AAdd 1 to the cell
BTake 1 from the cell
CRead one input character into the cell
DPrint the cell as a character

Every other character is ignored, so every text runs. The interpreter keeps the cell in a C# char, so it wraps at 65,536, and reading past the end of the input gives 65,535.

Example

The Hello World, in its rows of 64.

The Hello World, in its rows of 64. The last 23 B take the cell from the 33 of ! down to 10, a line feed.

A cat for three characters needs three CD.

Expected: hi!

Patterns it teaches

Further

Also in Jokes

Write your own in Run Convert a program from ABCD

Implementation

JavaScript interpreter, source and command line

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

Command line

shib run abcd -e 'CDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCD' --input 'abcdefghijklmnopqrstuvwxyz012345'
shib manual abcd

Source

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

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

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