aboutsummaryrefslogtreecommitdiff
path: root/day12.k
blob: 4897efe8506452232ce326f3601c4dbf29762da5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
/ k4/q with json.k loaded
d: .j.k@,/0::`day12

s1:{$[(0=@x)|(98=@x)|(9=@x);+/.z.s'x; 99=@x;.z.s@.:x; 0>@x;x; 0]}
s1 d

check:{~#&x~\:y}

s2:{$[(0=@x)|(98=@x)|(9=@x);+/.z.s'x; 99=@x;check[.:x;"red"]*.z.s@.:x; 0>@x;x; 0]}
s2 d