esolang

Suich

Every step moves one line down and one column right, so the program runs along a diagonal that wraps.

TuxCrafting, 2019 · Turing complete: yes · ●●● hard · esolangs.org

Tested with 5 known programs · Test method

Run it

Expected: Hello world!

The idea

TuxCrafting made Suich in 2019. A program is a few lines of commands, padded with spaces to the same length. One pointer picks the line and one picks the column, and after every command both go up by one and wrap. Control flow runs diagonally across the grid.

Read the story

There are no jumps. The only way to change the path is to make the column pointer skip one, which d does on a counter of 0 and I does at the end of the input. Each line has one counter, and nothing else holds data. The specification shows that Suich is Turing complete by compiling The Waterfall Model into it.

The machine

CommandDoes
iAdd 1 to this line's counter
dTake 1 off the counter, or skip a column if it is 0
IRead a character into the counter, or skip a column at the end of input
OPrint the character with the counter's code
hHalt
spaceNothing

Any other character is an error. Input and output are UTF-8, as in its Python interpreter.

Example

A program of one line is just a list.

A program of one line is just a list. The Hello world counts up or down to each letter and prints it. It has no comma.

The adder reads two characters into the counters of its first two lines. Then it moves the first counter into the second, one at a time. The third line's counter stays 0, so each of its ds knocks the diagonal one column right, and three of them bring it back to the same d and i. When the first counter is empty its own d skips, which lands on O and then h. The codes 48 and 49 make 97.

Expected: a

The truth machine treats NUL as 0 and any other character as 1. It prints NUL once and halts, or prints the character it read forever. The cat halts at its third step, before it reads anything, because its h lies on the diagonal before its I.

Patterns it teaches

Further

Two-dimensional languages

Write your own in Run Convert a program from Suich

Implementation

JavaScript interpreter, source and command line

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

Command line

shib run suich -e 'IOO d i
  d   h' --input ''
shib manual suich

Source

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

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

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