~pmikkelsen/aoc2021-k

d8fa0e2fd49caa6a2a1b88d109842693dfa1ea93 — Peter Mikkelsen 2 years ago 141e371
Day 12
2 files changed, 23 insertions(+), 0 deletions(-)

A 12.txt
M code.k
A 12.txt => 12.txt +22 -0
@@ 0,0 1,22 @@
ax-end
xq-GF
end-xq
im-wg
ax-ie
start-ws
ie-ws
CV-start
ng-wg
ng-ie
GF-ng
ng-av
CV-end
ie-GF
CV-ie
im-xq
start-GF
GF-ws
wg-LY
CV-ws
im-CV
CV-wg

M code.k => code.k +1 -0
@@ 17,3 17,4 @@ d8:{(+//:1 4 7 8=\:x;+/10/'x)}@{{x?2/|/y=/:z}[x][{,//:{(&/(|/x=2/|/z=/:)'y)#,z}[
d9:{{(+/1+,/x@'&'y;*/3#>#'1_=,/{{|/(0<x[1;1])*(x 1),(+x)1}''s[3;0;x]}/:(x<9)+{x*h^1+!(h:#x)*#*x}y)}[x;{1=+//:~x[1;1]<x}''s[3;10;x]]}`i$''0:`9.txt
d10:{{(+/{x@*&0<x}'x_y;{x@(<x)@_0.5*#x}@({y+x*5}/(1+!4)@z?-|)'x#y)}[((&/0>)');{((||':|{(y<0)&0=x+y}':)_)/:(x@")]}>([{<"?)y}[x]'0:`10.txt;x]}@{x,-x}@3 57 1197 25137
d11:{(+//:~100#x;#x)}@1_{$[1=#?,/x;x;{x*10>x}@{{$[c<10;10&;{x}](c:x[1;1])+/10=,/x}''s[3;0;x]}/:1+x]}\:`i$''0:`11.txt
d12:d12:{#(,/{?((1=+/`start=)')#{(x?`end)<!#x}_'({{(x>*y)&2>#y}[x]@(1<)##'=((|/48<`i$'$)')#y}[x]')#({(*|y)in x@(|y)@1}[y]')#(z,)'!y}[x;{{x!{y_?,/(y in')#x}[y]'x}[?,/x;x]}@(`n$'"-"\)'0:`12.txt]')/:,`start}'2 3