esolang

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

Expected: A

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.

CommandDoes
r1 l1Move the pointer right or left by the digit, never below cell 0
u1 d1Add the digit to the cell, or take it away
p0Start a new line and print the character with the code in cell 0
w0Print that character after the last one
i0Run the next command only if cell 0 is not 0
c0 n0Read 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.
Expected: hi Hello

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

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 targs

Source

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