diff options
Diffstat (limited to 'day15.k')
-rw-r--r-- | day15.k | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/day15.k b/day15.k new file mode 100644 index 0000000..241f5fe --- /dev/null +++ b/day15.k @@ -0,0 +1,12 @@ +d:0:"day15"; +ss:{1 _' (&y=y,x) _ y,x}; / split x at y +l:ss[;" "]' d; +v:{0$' -1 _' x@2 4 6 8}'l; / valuations +c:{0$' -1 _' x@10}'l; / calories + +n:{x,100-+/x}'!3#100; +n:n@&&/'1<n; / only positive ingredients +|/{*/0|+/v*x}'n + +n:n@&{500=+/c*x}'n; / only 500 calories +|/{*/0|+/v*x}'n |