tvl-depot/users/sterni/exercises/aoc/2022/05/5.bqn
sterni b8afed6dd4 refactor(sterni/aoc/2022/05): rank 2 array into list of lists w/ <˘
Change-Id: Ic536908bad5bb4af860ec53bd585ed74af3117af
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7557
Tested-by: BuildkiteCI
Autosubmit: sterni <sternenseemann@systemli.org>
Reviewed-by: sterni <sternenseemann@systemli.org>
2022-12-10 20:51:35 +00:00

18 lines
609 B
BQN
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

ReadDec, SplitOn, IsAsciiNum •Import "../../lib.bqn"
rsrc (<"") SplitOn •FLines "../05/input"
stacks {
count '0'-˜' ' (/) rs
' ' (/)¨<˘ (count×4) ((»(0=)(4|))/) > (-1)rs
}
cmds {011-˜ ReadDec¨ ((´IsAsciiNum)¨/) (<' ') SplitOn 𝕩}¨ rc
_ApplyCmd {
s Fn _self cft :
mk 2 c ((())) fs
(Fn m)(t) k˙(f) s
}
•Out "day05.1: "¨stacks _ApplyCmd˜´ cmds
•Out "day05.2: "¨stacks _ApplyCmd˜´ cmds