esolang

JR

Deadfish written in brackets, with more than one cell and a quine one character long.

Ethan, 2018 · Turing complete: no · ●○○ easy · esolangs.org

Tested with 2 known programs · Test method

Run it

Expected: Hello, world!

The idea

Ethan made JR in 2018 as a Deadfish variant with ten commands. The four Deadfish commands become ] [ ; and .. The six new ones print a cell as a character, set it to 0, move between cells, clear the screen and print the program itself. So the program ! is a quine.

Read the story

The specification says the data lives in an array of 8 cells. Its Ruby interpreter keeps a cell for every position and never wraps a value, and this implementation does what the interpreter does.

The machine

CharDoes
] [Add 1, subtract 1
;Square
@Set the cell to 0
< >Move one cell left or right
.Print the cell as a number
,Print the cell as a character
!Print the whole program
~Clear the screen

Every other character is ignored, so line breaks and spaces are free.

Example

The Hello World.

The Hello World. The first line makes 72 as 3 squared, minus 1, squared, plus 8, and prints the H. The second line leaves 44 in the first cell, the code of the comma, for later. Three cells take turns after that.

Expected: !
Expected: 81

The last one counts to 3, squares twice and prints 81 as a number.

Patterns it teaches

  • Every text runs: anything that is not a command is skipped.
  • Quine: one command prints the source, which makes the shortest quine.

Further

Also in Jokes

Write your own in Run Convert a program from JR

Implementation

JavaScript interpreter, source and command line

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

Command line

shib run jr -e '!'
shib manual jr

Source

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

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

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