refactor(sterni/aoc/2021): use a fold instead of last scan element
We can use the reverse swap trick to get a forward fold. Change-Id: I88185e2ff0b41ec1454f414db2d24b1c8173ac2d
This commit is contained in:
parent
6842e25f14
commit
c7ebb34f8f
1 changed files with 1 additions and 1 deletions
|
@ -237,7 +237,7 @@ day13Folds ← ParseFolds 1 ⊑ day13Input
|
||||||
|
|
||||||
# part 2
|
# part 2
|
||||||
|
|
||||||
PerformAllFolds ← {(-1)⊸⊑(<𝕩) {(𝕨 _Fold)´𝕩}` 𝕨}
|
PerformAllFolds ← {𝕩 {(𝕨 _Fold)´𝕩}˜´ ⌽𝕨}
|
||||||
DotMatrix ← {
|
DotMatrix ← {
|
||||||
⟨width, height⟩ ← 1+⌈´𝕩
|
⟨width, height⟩ ← 1+⌈´𝕩
|
||||||
{𝕩? '█';' '}¨ height‿width⥊≠¨⊔((⊣+(width⊸×)∘⊢)´)¨ 𝕩
|
{𝕩? '█';' '}¨ height‿width⥊≠¨⊔((⊣+(width⊸×)∘⊢)´)¨ 𝕩
|
||||||
|
|
Loading…
Add table
Reference in a new issue