From b5eb90196e1c3209cc72a3862234ef1997a10eca Mon Sep 17 00:00:00 2001 From: sterni Date: Tue, 14 Dec 2021 00:47:42 +0100 Subject: refactor(sterni/aoc/2021): determine width/height in the same fold Change-Id: I39410171402cedc3ee8d9ac972557656ed12de53 --- users/sterni/exercises/aoc/2021/solutions.bqn | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'users') diff --git a/users/sterni/exercises/aoc/2021/solutions.bqn b/users/sterni/exercises/aoc/2021/solutions.bqn index 0d7ed9dbcd9d..1810fc316b4b 100755 --- a/users/sterni/exercises/aoc/2021/solutions.bqn +++ b/users/sterni/exercises/aoc/2021/solutions.bqn @@ -239,8 +239,7 @@ day13Folds ← ParseFolds 1 ⊑ day13Input PerformAllFolds ← {(-1)⊸⊑(<𝕩) {(𝕨 _Fold)´𝕩}` 𝕨} DotMatrix ← { - width ← 1+⌈´⊑¨𝕩 - height ← 1+⌈´1⊸⊑¨𝕩 + ⟨width, height⟩ ← 1+⌈´𝕩 {𝕩? '█';' '}¨ height‿width⥊≠¨⊔((⊣+(width⊸×)∘⊢)´)¨ 𝕩 } -- cgit 1.4.1