def closed_explode.cells

minebender-game@1.0.0.0 · proof_inv.bend:238

import minebender-game@1.0.0.0/proof_inv.bend as ProofInv
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/proof_cells.bend as PS

238def closed_explode.cells(+w: Nat, +h: Nat, +layout: T.Grid(Bool), +shown: T.Grid(Bool), +p: T.Pos,
239  +mp: {B.mine(layout, p) == True{} : Bool}, +cl: {closed(w, h, layout, shown) == True{} : Bool},
240  ps: List<&2, T.Pos>, +ons: {PS.allp(~PS.WH, ~PS.onb, PS.WH{w, h}, ps) == True{} : Bool}) ->
241  {PS.allp(~CL, ~cl_f, CL{w, h, layout, B.set_at(Bool, shown, p, True{})}, ps) == True{} : Bool}:
242  match ps:
243    case Nil{}:
244      {==}
245    case +q <> +t:
246      +s2 = B.set_at(Bool, shown, p, True{})
247      %Equal.sym(Bool, cl_f(CL{w, h, layout, s2}, q), True{},
248        closed_explode.cell(w, h, layout, shown, p, mp, cl, q,
249          PS.allp_head(~PS.WH, ~PS.onb, PS.WH{w, h}, q, t, ons),
250          Bool.and(B.at(Bool, False{}, s2, q), B.zero(w, h, layout, q)), {==})) :
251        {Bool.and(_, PS.allp(~CL, ~cl_f, CL{w, h, layout, s2}, t)) == True{} : Bool}
252      closed_explode.cells(w, h, layout, shown, p, mp, cl, t, PS.allp_tail(~PS.WH, ~PS.onb, PS.WH{w, h}, q, t, ons))

Uses (20)

Used by (1)