Targs
Brainfuck with two characters to every command and no loops at all.
SpaceByte, 2022 · Turing complete: no · ●○○ easy · esolangs.org
Tested with 5 known programs · Test method
Run it
The idea
SpaceByte made Targs in 2022 and also called it EsoTargs. The name is short for Two Args. Every command is a letter and one argument, and only the first two characters of a command count, so u12 is the same as u1. To add 104 to a cell you write u9 eleven times and then u5.
Read the story
The commands come from brainfuck, but there is no loop. The only control is i, which skips the next command when a cell is 0. So every program runs once from left to right and stops, and the specification counts Targs as total.
The machine
A row of cells that start at 0, and a pointer at cell 0. Commands are split by spaces or line breaks.
| Command | Does |
|---|---|
r1 l1 | Move the pointer right or left by the digit, never below cell 0 |
u1 d1 | Add the digit to the cell, or take it away |
p0 | Start a new line and print the character with the code in cell 0 |
w0 | Print that character after the last one |
i0 | Run the next command only if cell 0 is not 0 |
c0 n0 | Read a character into cell 0 as its code, or as a digit |
For p, w, i, c and n the argument p means the pointer's cell. Commands that start with any other letter are ignored.
Example
The second is the Hello + Hi program, which uses every command but input.
The second is the Hello + Hi program, which uses every command but input. It prints hi, then Hello on a new line. Cell 0 climbs to 104 for h, then to 105 for i; cell 1 holds 72 for H, and cell 0 falls back to 101 for e.
Further
See also
Cell-based
Write your own in Run Convert a program from Targs
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: targs.
Command line
shib run targs -e 'c0 w0' --input 'A'shib manual targsSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/targs.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org