From aa0075023e1147344faa386f72db3cdaed0ed9b0 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Thu, 30 May 2024 14:32:51 +0100 Subject: [PATCH] 20a example OK Fails on the real input though. --- 20/20a.bqn | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/20/20a.bqn b/20/20a.bqn index be328ad..4414236 100644 --- a/20/20a.bqn +++ b/20/20a.bqn @@ -5,17 +5,17 @@ Main←{ 𝕊 orig: cur←orig #JumpFwd←{(1⊸⌽)⌾(((1+|𝕨)⊸↑)∘((⊑𝕩⊐𝕨)⊸⌽)) 𝕩} #Jump←{𝕨≥0 ? 𝕨 JumpFwd 𝕩; ⌽ 𝕨 JumpFwd ⌽𝕩} + Wrap←{1+(𝕨-1)|𝕩-1} Jump←{ from ← ⊑𝕩⊐𝕨 - to ← (¯1+≠𝕩)|𝕨+from + to ← (≠𝕩) Wrap 𝕨+from len ← to-from - •Show from‿to‿len - •Show ((1+|len)⊸↑∘((to⌊from)⊸↓)) 𝕩 ((×len)⊸⌽) ⌾ ((1+|len)⊸↑∘((to⌊from)⊸↓)) 𝕩 } { •Show cur ↩ 𝕩 Jump cur }¨orig + +´((≠cur)|(cur⊐0)+⟨1000,2000,3000⟩)⊏cur } •Show Main Prep •file.Lines ⊑•args -- 2.30.2