esolang

๐Ÿข

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

Expected: 321

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

TurtlesDoes
1, nAdd n to the accumulator
2, nTake n from the accumulator
3Print the accumulator as a character
3, 1Print it as a decimal number
4Read a character into the accumulator
5, nMark label n
6, nJump to label n if the accumulator is not 0
7, 1, nMove the tape pointer n cells left
7, 2, nMove it n cells right
8, 1Store the accumulator in the cell
8, 2Load 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.

Expected: A

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

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 u1f422

Source

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