def cascade.go
import ezx@1.11.0.0/src/ws/moved.bend as Movedimport Base
276# rounds, under fuel, until one moves no member further
277def cascade.go(fuel: Nat, +ctx: Ctx, +ms: List<&2, Shift>) -> List<&2, Shift>:
278 match fuel:
279 case 0n:
280 ms
281 case 1n+f:
282 +next = round(ctx, ms)
283 cascade.pick(moves.eq(ms, next), ms, _u => cascade.go(f, ctx, next))