From: Ben Harris Date: Thu, 9 May 2024 12:43:49 +0000 (+0100) Subject: 09a: restructure to calculate head and tail paths separately X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~bjharris/git?a=commitdiff_plain;h=013ad025b20ec3ca73d7847e994a9a1ca4b68cc3;p=aoc-2022.git 09a: restructure to calculate head and tail paths separately --- diff --git a/09/09a.bqn b/09/09a.bqn index 9d0161a..4f9d027 100644 --- a/09/09a.bqn +++ b/09/09a.bqn @@ -8,8 +8,10 @@ Prep←{ StepH←{h𝕊m:h+m} StepT←{t𝕊h:t+(×h-t)×(∨´1<|h-t)} -Step←{⟨h,t⟩𝕊m:h StepH↩m,t StepT↩h,⟨h,t⟩} -Main←{+´∊1⊑¨ (<⟨⟨0,0⟩,⟨0,0⟩⟩)Step`𝕩} +Main←{ + start←<⟨0,0⟩ + +´∊ start StepT` start StepH` 𝕩 +} •Show Main Prep •file.Lines ⊑•args