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.
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
}