From 85499f93fa2f62c088f8315b0ade69889df96d70 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Thu, 30 May 2024 20:45:16 +0100 Subject: [PATCH] 20a done Thanks to cardboard Verity for providing the answer, which is that it doesn't matter where the start of the list is: everything treats it as circular. --- 20/20a.bqn | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/20/20a.bqn b/20/20a.bqn index a7686ae..26218d9 100644 --- a/20/20a.bqn +++ b/20/20a.bqn @@ -1,14 +1,8 @@ Prep←•ParseFloat¨ Main←{ 𝕊 orig: - Wrap←{1+(𝕨-1)|𝕩-1} - Jump←{ - from ← ⊑𝕩⊐𝕨 - to ← (≠𝕩) Wrap 𝕨+from - len ← to-from - ((×len)⊸⌽) ⌾ ((1+|len)⊸↑∘((to⌊from)⊸↓)) 𝕩 - } - cur ← orig Jump´ ⌽orig + Twiddle←{ (1⊸⌽)⌾((1+(¯1+≠𝕩)|𝕨)⊸↑) (⊑𝕩⊐𝕨)⌽𝕩 } + cur ← orig Twiddle´ ⌽orig +´((≠cur)|(cur⊐0)+⟨1000,2000,3000⟩)⊏cur } -- 2.30.2