def open_safe_c.go

minebender-game@1.0.0.0 · proof_laws.bend:722

import minebender-game@1.0.0.0/proof_laws.bend as ProofLaws
import Base
import minebender-game@1.0.0.0/types.bend as T
import minebender-game@1.0.0.0/board.bend as B
import minebender-game@1.0.0.0/game.bend as G
import minebender-game@1.0.0.0/LAWS.bend as L

722def open_safe_c.go(+w: Nat, +h: Nat, +layout: T.Grid(Bool), +s: T.Grid(Bool), +f: List<&2, T.Pos>, +p: T.Pos,
723  bm: {B.mine(layout, p) == False{} : Bool}, +c: Bool) ->
724  {L.is_lost(G.status(G.open.go(c, B.mine(layout, p), G.Game{w, h, layout, s, f, T.Playing{}}, p))) == False{} : Bool}:
725  match c:
726    case False{}:
727      {==}
728    case True{}:
729      +g0 = {G.Game{w, h, layout, s, f, T.Playing{}} : G.Game}
730      %Equal.sym(Bool, B.mine(layout, p), False{}, bm) :
731        {L.is_lost(G.status(G.open.go(True{}, _, g0, p))) == False{} : Bool}
732      +start = {[G.Work{p, Nil{}}] : List<&2, G.Work>}
733      is_lost_wop(G.all_safe(w, h, layout,
734        G.flood(B.count_false(s), start, G.head_hidden(w, h, s, start), w, h, layout, s)))

Uses (18)

Used by (1)