diff options
-rw-r--r-- | day6.k | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/day6.k b/day6.k index 6f95738..fbc112e 100644 --- a/day6.k +++ b/day6.k @@ -8,9 +8,9 @@ l:ss[;" "]' d; f:1000 1000 # 0; -on: {f[rg[x[0];x[2]];rg[x[1];x[3]]]:1}; -off: {f[rg[x[0];x[2]];rg[x[1];x[3]]]:0}; -toggle:{f[rg[x[0];x[2]];rg[x[1];x[3]]]~:}; +on: {f[rg . x 0 2; rg . x 1 3]:1}; +off: {f[rg . x 0 2; rg . x 1 3]:0}; +toggle:{f[rg . x 0 2; rg . x 1 3]~:}; op:{ :["on"~x[1];on[,/ds'x[2 4]] @@ -26,10 +26,10 @@ op' l; f:1000 1000 # 0; -on: {f[rg[x[0];x[2]];rg[x[1];x[3]]]+:1}; -off: {f[rg[x[0];x[2]];rg[x[1];x[3]]]-:1 - f[rg[x[0];x[2]];rg[x[1];x[3]]]|:0}; -toggle:{f[rg[x[0];x[2]];rg[x[1];x[3]]]+:2}; +on: {f[rg . x 0 2; rg . x 1 3]+:1}; +off: {f[rg . x 0 2; rg . x 1 3]-:1 + f[rg . x 0 2; rg . x 1 3]|:0}; +toggle:{f[rg . x 0 2; rg . x 1 3]+:2}; op' l; |