LOOM STUDIO

LOOM is a tiny language that describes woven cloth. A loom holds vertical warp threads, each tied to one of up to 8 shafts. On every pick some shafts lift: lifted threads show their own colour in that row, the others show the weft colour the shuttle is carrying. Write a program, press Weave, and watch the cloth appear row by row.

Language cheat sheet
loom 24 24               // width (warp threads) and height (picks)
palette a=#1d3557 b=#f1faee   // name colours with single letters
warp a*2 b*2             // warp colours, tiled across; also (a b)*3 and mirror(a b c)
thread 1-4               // shaft of each warp thread; ranges and mirror(1-4) work too
treadle 1 12             // treadle 1 lifts shafts 1 and 2 (also - none, * all, !12 all but 1,2)
shuttle a b              // cyclic weft colours for picks that give no colour
pick t1                  // weave a row using treadle 1 (or a lift like 13, or: pick b 13)
cross 1 2   drift 1      // swap two warp threads / rotate the whole warp sideways
maxfloat 4               // error if any thread or weft skips more than 4 in a row
repeat 6 { ... }         // repeat a block (put } alone on its own line)
Speed