Sattolo cycle: Difference between revisions
→{{header|BQN}}: Switch to fold-based implementation
(add BQN) |
(→{{header|BQN}}: Switch to fold-based implementation) |
||
Line 597:
=={{header|BQN}}==
Uses a fold in order to make the swaps in a functional style. It doesn't mutate the argument array, but after the initial copy is made CBQN is able to update it in place.
<lang bqn>Sattolo ← {
Swap ← {
i 𝕊 𝕩:
{▼
𝕩 Swap´ 1↓↕≠𝕩
}
|