refactor(sterni/aoc/2022/05): improve parsing a bit

By taking advantage of filling (ironically) we can avoid creating a spec
in an ugly way. Additionally we transpose before parsing which doesn't
really make all that much of a difference, though.

Change-Id: Ida593138654f8367d666447f2b62013e8ddff01e
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7535
Reviewed-by: sterni <sternenseemann@systemli.org>
Autosubmit: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
This commit is contained in:
sterni 2022-12-06 09:39:32 +01:00 committed by clbot
parent efbac0813c
commit 17e0a74e7b

View file

@ -3,8 +3,7 @@ rs‿rc ← (<"") SplitOn •FLines "../05/input"
stacks {
count '0'-˜' ' (/) rs
spec 0<(-1)(-1)(000)¨1+count
' ' (/)¨˘>spec/¨(-1)rs
' ' (/)¨˘ (count×4) ((»(0=)(4|))/) > (-1)rs
}
cmds {011-˜ ReadDec¨ ((´IsAsciiNum)¨/) (<' ') SplitOn 𝕩}¨ rc