From 3f8c99f5c33632b0e69bc3334793eabf847c48f8 Mon Sep 17 00:00:00 2001 From: sterni Date: Thu, 16 Dec 2021 00:44:51 +0100 Subject: 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 --- users/sterni/exercises/aoc/2021/solutions.bqn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'users/sterni/exercises') diff --git a/users/sterni/exercises/aoc/2021/solutions.bqn b/users/sterni/exercises/aoc/2021/solutions.bqn index 443dd61a01a4..47e858cff588 100755 --- a/users/sterni/exercises/aoc/2021/solutions.bqn +++ b/users/sterni/exercises/aoc/2021/solutions.bqn @@ -239,7 +239,7 @@ day13Folds ← ParseFolds 1 ⊑ day13Input PerformAllFolds ← {𝕩 {(𝕨 _Fold)´𝕩}˜´ ⌽𝕨} DotMatrix ← { - ⟨width, height⟩ ← 1+⌈´𝕩 + ⟨width, height⟩ ← 1+⌈˝∘‿2⥊∾𝕩 {𝕩? '█';' '}¨ height‿width⥊≠¨⊔((⊣+(width⊸×)∘⊢)´)¨ 𝕩 } -- cgit 1.4.1