12 /direction { % i -- bool
13 dup 2 lt { pop true } {
14 dup 1 add dup pot dup 3 -1 roll eq { pop pop true } {
15 2 div 1 sub 2 mul exch sub direction not
20 /path { % cr dx dy -- cr
22 4 1 roll 3 copy L pop 4 -1 roll direction {
38 //LINE_CAP_ROUND set-line-cap
39 //LINE_JOIN_ROUND set-line-join
42 256 256 m 12 0 path 0 0 0 rgb set-source stroke
43 256 256 m -12 0 path 1 0 0 rgb set-source stroke
44 256 256 m 0 12 path 0 1 0 rgb set-source stroke
45 256 256 m 0 -12 path 0 0 1 rgb set-source stroke
47 /target get (out.png) write-to-png pop