esolang

Eezy

Two registers, seven commands and labels that are only numbers. A Minsky machine small enough to build inside other esolangs.

ChuckEsoteric08 · Turing complete: yes · ●●○ moderate · esolangs.org

Tested with 2 known programs · Test method

Run it

Expected: Hello, World!

The idea

ChuckEsoteric08 based Eezy on the Minsky machine and made it easy to implement in other esolangs. There are two registers. They hold numbers of any size, never below 0, and one of them is current. Labels have no names. A label is a run of stars, and its number is how many stars there are. A jump names its label the same way, with a run of ^.

Read the story

A machine with two counters and a jump on zero can compute anything a Turing machine can, and the specification counts Eezy as Turing complete.

The machine

CommandDoes
+ -Add 1 to the current register, or take 1 away
~Make the other register current
.Print the current register
* ** ...Mark label 1, label 2 and so on
0^ 0^^ ...Jump to label 1, 2 and so on if the current register is 0
1^ 1^^ ...Jump there if it is not 0

The specification lets an implementation print a number or a character. This implementation prints the character with that code, which the Hello, World! needs.

Example

Hello, World! The second register counts 9 times around the loop, and each time the first one gets 8, so…

Hello, World! The second register counts 9 times around the loop, and each time the first one gets 8, so it ends at 72 for the H. After that every letter is a step up or down from the one before.

A loop of three. The second register holds 3 and the first holds 33, the code for !. Each time around, ~ switches to the first register to print it and back to the second to count down.

Expected: !!!

Patterns it teaches

Further

Cell-based

Write your own in Run Convert a program from Eezy

Implementation

JavaScript interpreter, source and command line

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

Command line

shib run eezy -e '++++++++++
*
.
-
0^^
1^
**'
shib manual eezy

Source

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

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

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