esolang

OZZo

Every instruction is four binary digits, and printing reads the memory backwards, so Hello World has to be typed in backwards.

Fly, 2023 · Turing complete: no · ●○○ easy · esolangs.org

Tested with 2 known programs · Test method

Run it

Expected: Hello, World!

The idea

Fly made oZZo in 2023. The name stands for "one zero zero one", which is 1001, the code for print. There is one memory, one line of input and an errorlevel of 0 or 1. The program runs once from the first instruction to the last, and nothing jumps back.

Read the story

The specification explains that binary numbers are read backwards, so the memory is printed backwards too. To print Hello, World! you type the input as !dlroW ,olleH. The specification says the language is not Turing complete, and that a bigger memory would not change that.

The machine

CodeDoes
1111 0000Set the memory to true or false
1110Read a line of input
1010Copy that line into the memory
1001Print the memory backwards, then a line feed
1101Empty the memory
0101 1011Set the errorlevel to 1 or 0
0100 0110If the errorlevel is 1 or 0, run the next instruction
0111Stop

The checks follow the Python exactly. When the errorlevel matches, the check runs the instruction after it, and then the program goes on as usual and runs that instruction a second time. The Python also looks for the first check with the same code in the program, so a second 0100 runs whatever follows the first one.

Example

The Hello World reads a line, copies it into the memory and prints it backwards.

The Hello World reads a line, copies it into the memory and prints it backwards.

Expected: true

With the errorlevel at its start value of 0, 0110 runs the print once more. With 0101 before it, the print runs once.

Expected: true true
Expected: true

Further

Also in Jokes

Write your own in Run Convert a program from OZZo

Implementation

JavaScript interpreter, source and command line

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

Command line

shib run ozzo -e '111010101001' --input '!dlroW ,olleH'
shib manual ozzo

Source

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

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

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