esolang

◧◨

Two symbols and two commands. One flips a bit and steps right, the other may jump and steps left.

C++DSUCKER, 2025 · Turing complete: yes · ●●○ moderate · esolangs.org

Tested with 4 known programs · Test method

Run it

Expected: [1]

The idea

C++DSUCKER made ◧◨ in 2025. Programs are written in two squares, ◧ with its left half black and ◨ with its right half black, and the specification writes them as 0 and 1 beside each example. There is a tape of bits, unbounded both ways and all 0, and a pointer.

Read the story

There are two commands, and they share symbols. ◨◧◨ toggles the bit under the pointer and moves right. ◧◧ followed by n ◨ jumps (-1)^n * ceil(n/2) instructions if the bit is 1, and then moves left either way. So a jump with no ◨ runs itself again, one ◨ jumps back one, two go on to the next instruction, three jump back two and four jump ahead two. The specification gives a PEG grammar that reads any program one way only, as a jump's run of ◨ stops where a ◨◧◨ begins.

The specification builds plain moves from these. ◧◧◨◨ always lands on the next instruction, so it only steps left. A toggle followed by it flips a bit and comes back, and one more toggle makes a step right. With these and a pair of jumps for a loop, all of Smallfuck can be built, so ◧◨ is Turing complete.

The machine

CodeDoes
◨◧◨Toggle the bit at the pointer, then move right
◧◧ and n ◨If the bit is 1, jump (-1)^n * ceil(n/2) instructions; then move left

The run ends when control leaves the program at either end. Every other character is ignored. The specification has no input or output, so this implementation shows the tape when the run ends. It prints the cells from the leftmost to the rightmost of cell 0, the pointer and every 1, with the pointer's cell in brackets.

Example

A toggle and a move right.

A toggle and a move right.

Expected: 0[0]

The toggle sets the bit and steps right. Its jump finds a 0 there, so it does not jump, and it steps back. The move right toggles the bit twice, which leaves it as it was, and the last toggle steps right.

This one toggles, moves right and toggles again, which leaves two 1s. It ends with the find zero to the left, a jump of 0 that repeats while it stands on a 1. It steps left over both 1s and once more off the 0 it finds.

Expected: [0]011

The specification writes its reset of the current bit in jump and toggle mnemonics. In symbols it is 12 instructions, and its first jump goes 7 ahead, which takes 14 ◨. It borrows the cell to the left and puts it back. It clears the first of two 1s and leaves the second.

Expected: [0]1

The find zero to the right ends in symbols it marks as invalid code, and the grammar agrees. This implementation refuses it with a syntax error at the 15th symbol.

Patterns it teaches

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: u25e7-25e8.

Command line

shib run u25e7-25e8 -e '◧◧'
shib manual u25e7-25e8

Source

Module
langs/wiki/ports.js
Interpreter
langs/wiki/u25e7-25e8.js

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

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