File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -113,21 +113,20 @@ defn main(steps=511):
113113 nx ny = : +
114114 [(x + condp(== dir 0 1 2 -1 0))
115115 (y + condp(== dir 1 1 3 -1 0))]
116- ob ib = : nth([[8 4][2 1][4 8][1 2]] dir )
116+ ob ib = : dir. nth([[8 4][2 1][4 8][1 2]])
117117 data = : update-in(data [y x] safe-bit-or ob)
118118 .update-in([ny nx] safe-bit-or ib)
119119 bbox = : +
120120 [min(minx nx) max(maxx nx)
121121 min(miny ny) max(maxy ny)]
122122 if i < steps :
123- recur : i.++ [nx ny] data bbox
123+ recur : i.++, [nx ny], data, bbox
124124 vector : data bbox
125125
126- doseq y (range miny maxy.++) :
127- chars = :
128- for x (range minx maxx.++) :
129- nth(" ╵╷│╴┘┐┤╶└┌├─┴┬┼" get-in(data [y x] 0))
130- say : str(chars*)
126+ each y (miny .. maxy) :
127+ say : !:join
128+ each x (minx .. maxx) :
129+ get-in(data [y x] 0).nth(" ╵╷│╴┘┐┤╶└┌├─┴┬┼")
131130
132131defn i-to-dir(n) :
133132 n.bit-xor(bit-shift-right(n 1)):Long/bitCount % 4
You can’t perform that action at this time.
0 commit comments