Fails on the real input though.
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