tvl-depot/users/sterni/exercises/aoc/2022/05/5.bqn

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
648 B
BQN
Raw Normal View History

ReadDec, SplitOn, IsAsciiNum •Import "../../lib.bqn"
rsrc (<"") SplitOn •FLines "../05/input"
stacks {
count '0'-˜' ' (/) rs
spec 0<(-1)(-1)(000)¨1+count
' ' (/)¨˘>spec/¨(-1)rs
}
cmds {011-˜ ReadDec¨ ((´IsAsciiNum)¨/) (<' ') SplitOn 𝕩}¨ rc
ModestTake (<)
_ApplyCmd {
cft 𝕩
m 𝔽 c ModestTake f𝕨
(m)(t) (c)(f)𝕨
}
•Out "day05.1: "¨stacks _ApplyCmd˜´ cmds
•Out "day05.2: "¨stacks _ApplyCmd˜´ cmds