๐ข
One emoji, counted. Every command and every number is a row of turtles.
VilgotanL, 2021 ยท Turing complete: yes ยท โโโ easy ยท esolangs.org
Tested with 3 known programs ยท Test method
Run it
The idea
VilgotanL made ๐ข in 2021 for an esojam on Truttle1's Discord server. The turtle is the only character that counts. A line holds groups of turtles split by spaces; the size of the first group picks the command and the size of the last group is its number. The machine is an accumulator and a tape of cells, both holding integers without bounds.
Read the story
The specification warns writers of interpreters that ๐ข is two UTF-16 code units, so in JavaScript one turtle has a length of 2.
The machine
| Turtles | Does |
|---|---|
| 1, n | Add n to the accumulator |
| 2, n | Take n from the accumulator |
| 3 | Print the accumulator as a character |
| 3, 1 | Print it as a decimal number |
| 4 | Read a character into the accumulator |
| 5, n | Mark label n |
| 6, n | Jump to label n if the accumulator is not 0 |
| 7, 1, n | Move the tape pointer n cells left |
| 7, 2, n | Move it n cells right |
| 8, 1 | Store the accumulator in the cell |
| 8, 2 | Load the cell into the accumulator |
# starts a comment. A missing n counts as 0, and reading past the end of the input gives 0.
Example
A count down.
A count down. The accumulator starts at 3, and label 1 prints it, takes 1 away and jumps back while it is not 0.
Reading one character and printing it.
The Hello World is 27 lines. Each one moves the accumulator to the next letter or prints it, with 87 turtles for the step from the space up to w, and it ends with a line feed. Its truth machine keeps the input in a cell, takes 49 away and loops on label 2 only when the input was 1.
Patterns it teaches
- Turing tarpit: eleven commands, and the specification says that brainfuck and Minsky machines translate into them.
- Encoding tricks: every number is written in unary, as a row of turtles.
Further
See also
Cell-based
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: u1f422.
Command line
shib run u1f422 program.txt --input '0'The program is long; save it as program.txt first.
shib manual u1f422Source
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/u1f422.js
Docs: Kernel instructions ยท The .shib format ยท Command line ยท Adding a language
Source esolangs.org (CC0) ยท Edit on esolangs.org