esolang

Caker

A bit tape where the bit under the head decides which way you go, and characters are stacked up one bit at a time.

TuxCrafting, 2016 · Turing complete: unknown · ●●○ moderate · esolangs.org

Tested with 2 known programs · Test method

Run it

Expected: 10

The idea

TuxCrafting made Caker in 2016. The tape holds bits, and its two moving commands have no direction of their own. On a 0 they go left and on a 1 they go right. Ω moves the head that way and ω flips the bit next to it on that side.

Read the story

Output goes through a second stack of bits. θ pushes the bit under the head, and Θ prints the whole stack as one character, the first bit pushed being the highest, and empties it.

The machine

CommandDoes
ωFlip the bit to the left on a 0, to the right on a 1
ΩMove left on a 0, right on a 1
θ ΘPush the bit onto the print stack; print the stack as a character
( ... )Repeat while the bit is 1
γ ΓPrint or read a bit as the character 0 or 1
ξ ΞRead a character onto the print stack; pop a bit into the cell
ΔSet the cell to a random bit

ξ pushes the 8 bits of a byte and Θ prints the low 8 bits of the stack. The random bits come from a fixed sequence, so a run replays.

Example

ωΩ flips the bit left of the start and moves onto it.

ωΩ flips the bit left of the start and moves onto it. From there Ω steps between a 1 and a 0, so each θ or γ can use either bit.

The print stack example pushes 100011, which is 35, and Θ prints it.

Expected: #

The Hello, World! program is 147 commands. 88 of them push a bit, 45 step between the 1 and the 0, and 13 print a character.

Expected: Hello, World!

The cat is ωΩ(ξΘ). It reads and prints characters for ever, as the bit under its loop stays 1.

Patterns it teaches

  • Turing tarpit: eleven commands on single bits, and no fixed direction.

Further

Cell-based

Write your own in Run Convert a program from Caker

Implementation

JavaScript interpreter, source and command line

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

Command line

shib run caker -e 'ωΩθΩθθθΩθθΘ'
shib manual caker

Source

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

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

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