Crochetable Cyclic Tag
Bitwise Cyclic Tag written as a crochet pattern. The program runs on a hook, and the output is a piece of fabric.
2021 · Turing complete: yes · ●●○ moderate · esolangs.org
Tested with 3 known programs · Test method
Run it
The idea
Crochetable Cyclic Tag writes Bitwise Cyclic Tag programs as crochet pattern instructions. The data is a row of stitches, double crochet for 1 and single crochet for 0. A pattern has only four kinds of rows, and two of them are conditional, which is all that cyclic tag needs.
Read the story
The specification says the output is a deterministic crochet pattern or a physical textile. This implementation draws a chart of the finished piece.
The machine
The input is the home row, worked onto a foundation chain. Every instruction row is followed by a std row, which puts a single crochet on each double and a double on each single, so every pair of rows keeps the same height and the same bits.
| Row | Does | Cyclic tag |
|---|---|---|
dec-ss | A slip stitch into the first stitch, then as std | 0 deletes the first bit |
inc-sc | If the first stitch would be a double, as std and one extra single at the end; else skipped | 10 |
inc-dc | The same with an extra double | 11 |
The pattern repeats from its first instruction row until the last row is a single slip stitch, the point of the piece. If a whole repeat works no row, nothing can change any more, and the crocheter may stop. A home row of only single crochets never lets an increase happen.
Example
The triangle swatch has one instruction row, dec-ss.
The triangle swatch has one instruction row, dec-ss. On the home row 101 it takes one stitch off each pair of rows until the piece comes to a point.
•
+
Ŧ•
+Ŧ
Ŧ+•
+Ŧ+
Ŧ+Ŧ
ᴑᴑᴑ
Odd rows start at the right, so the slip stitches stand on the right edge and an increase grows the piece to the left. inc-sc adds a single crochet before two decreases finish it.
The chart for the home row 1011101 is checked stitch for stitch, with 15 rows above the chain.
Patterns it teaches
- Tag systems: cyclic tag with the data as a row of stitches.
- Camouflage: the program reads as an ordinary crochet pattern.
See also
Also in Camouflage
Write your own in Run Convert a program from Crochetable Cyclic Tag
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: crochetable-cyclic-tag.
Command line
shib run crochetable-cyclic-tag -e '# Simple decreasing triangle swatch
1. Any sequence of sc / dc stitched onto an appropriately sized foundation chain.
2. std
3. dec-ss
4. std
Repeat from Row 3.' --input '1011101'shib manual crochetable-cyclic-tagSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/crochetable-cyclic-tag.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org