XXIIVV

Turquoise is a line-plotting virtual machine.

Turquoise is a little system with 16 operations, to plot lines from sets of rules. The program starts at the center of the screen, with all registers set to 0x00.

VM

Runtimeposition2 shortsPosition on the x and y axis
return2 shortsReturn position
scalebyteLength of segment
Registerdrawing1 bitOn/off
color1 bitA/B
mirror1 bitOff/on
flipx1 bitOff/on
flipy1 bitOff/on
return1 bitFalse/true

Rules

Turtoise programs are defined as a set of rules in the follow format:

lengthbyteNumber of commands in the body.
cyclesbyteNumber of times this rule will run.
body..Commands for the rule.

The following example rulle uses 26 operations to draw a circle from 2 arc segments, the total program is 15 bytes, the first byte is the rule length, and the second is the number of times the rule will repeat:

1a01 4454 5551 5113 7445 4555 1511 b7

Rules are made of 16 line plotting operations:

00000Push()/Pop()81000Move(0,-1)
10001Move(1,0) 91001Move(1,-1)
20010Move(-1,0)a1010Move(-1,-1)
30011Flip(1,0)b1011Flip(0,1)
40100Move(0,1) c1100Color()
50101Move(1,1) d1101Draw()
60110Move(-1,1)e1110Scale(1)
70111Mirror()f1111Scale(-1)

The commands are run at each pixel.

MoveMove by a length equal to the scale register.
FlipFlip movement axis vectors.
MirrorSwap the target axis with the move operation.
DrawToggle between drawing and not drawing.
ColorToggle between painting and erasing.
ScaleModify the length of line segments.

Movement

Moving is done between direct or diagonal pixels.

645
201
a89

incoming identity