refactor(sterni/aoc/2021): fold over 2d array instead of nested list
Seems to save some allocations and thus recover some performance compared to the two separate folds we had before. Change-Id: Ie3d283103e6a9b8aa702db633d9c988fda1b2903 Reviewed-on: https://cl.tvl.fyi/c/depot/+/4348 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>
This commit is contained in:
parent
0f5cc25697
commit
3f8c99f5c3
1 changed files with 1 additions and 1 deletions
|
@ -239,7 +239,7 @@ day13Folds ← ParseFolds 1 ⊑ day13Input
|
|||
|
||||
PerformAllFolds ← {𝕩 {(𝕨 _Fold)´𝕩}˜´ ⌽𝕨}
|
||||
DotMatrix ← {
|
||||
⟨width, height⟩ ← 1+⌈´𝕩
|
||||
⟨width, height⟩ ← 1+⌈˝∘‿2⥊∾𝕩
|
||||
{𝕩? '█';' '}¨ height‿width⥊≠¨⊔((⊣+(width⊸×)∘⊢)´)¨ 𝕩
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue