def works_ok

minebender-game@1.0.0.0 · proof_flood.bend:504

import minebender-game@1.0.0.0/proof_flood.bend as ProofFlood
import Base
import minebender-game@1.0.0.0/types.bend as T
import minebender-game@1.0.0.0/game.bend as G
import minebender-game@1.0.0.0/LAWS.bend as L

504# Each queued cell's ghost path is a zero walk from p0 to it.
505def works_ok(ws: List<&2, G.Work>, +w: Nat, +h: Nat, +layout: T.Grid(Bool), +p0: T.Pos) -> Bool:
506  match ws:
507    case Nil{}:
508      True{}
509    case G.Work{c, back} <> t:
510      L.zero_walk(List.reverse(&2, T.Pos, back), w, h, layout, p0, c) && works_ok(t, w, h, layout, p0)

Uses (9)

Used by (11)