~pmikkelsen/aoc2021-k

23404c747399ff9eddb3df0bb3368cb7928c9c57 — Peter Mikkelsen 2 years ago 405f7a4 master
Day 14
2 files changed, 103 insertions(+), 0 deletions(-)

A 14.txt
M code.k
A 14.txt => 14.txt +102 -0
@@ 0,0 1,102 @@
PFVKOBSHPSPOOOCOOHBP

FV -> C
CP -> K
FS -> K
VF -> N
HN -> F
FF -> N
SS -> K
VS -> V
BV -> F
HC -> K
BP -> F
OV -> N
BF -> V
VH -> V
PF -> N
FC -> S
CS -> B
FK -> N
VK -> H
FN -> P
SH -> V
CV -> K
HP -> K
HO -> C
NO -> V
CK -> C
VB -> S
OC -> N
NS -> C
NF -> H
SF -> N
NK -> S
NP -> P
OO -> S
NH -> C
BC -> H
KS -> H
PV -> O
KO -> K
OK -> H
OH -> H
BH -> F
NB -> B
FH -> N
HV -> F
BN -> S
ON -> V
CB -> V
CF -> H
FB -> S
KF -> S
PS -> P
OB -> C
NN -> K
KV -> C
BK -> H
SN -> S
NC -> H
PK -> B
PC -> H
KN -> S
VO -> V
FO -> K
CH -> B
PH -> N
SO -> C
KH -> S
HB -> V
HH -> B
BB -> H
SC -> V
HS -> K
SP -> V
KB -> N
VN -> H
HK -> H
KP -> K
OP -> F
CO -> B
VP -> H
OS -> N
OF -> H
KK -> N
CC -> K
BS -> C
VV -> O
CN -> H
PB -> P
BO -> N
SB -> H
FP -> F
SK -> F
PO -> S
KC -> H
VC -> H
NV -> N
HF -> B
PN -> F
SV -> K
PP -> K

M code.k => code.k +1 -0
@@ 19,3 19,4 @@ d10:{{(+/{x@*&0<x}'x_y;{x@(<x)@_0.5*#x}@({y+x*5}/(1+!4)@z?-|)'x#y)}[((&/0>)');{(
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:{#(,/{?((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
d13:{{(+/+/y[z;1#x];" #"@y[z;x])}[*|x;{x{(({"yx"!(x;{+x[y;+z]}[x])}[{{|/{((x-#y)#,(#*y)#0),y}[(#x)|#y]'(x;y)}[x#y;|(x+1)_y]}])@*y)[. 1_y;x]}/y};{+({(*x)^(*/x)#0}1+|/x).[;;1]/x}@*x]}@{{(. y#x;{x[11],13_x}'(y+1)_x)}[x]@*&~#'x}@0:`13.txt
d14:{{{(*x)-*|x}@>*|(z;{{(+/*'y;x[1]++/(*|)'y)}[y]@{{((z[0],x;x,z[1])!y;x!y)}[y@z;x@z;z]}[*y;x]'!*y}[y])/:(((!y)!0)+/1_{(,y,x)!1}':*x;#'=*x)}[x;(!).+({(2#x;*|x)})'2_x]'10 40}@0:`14.txt