def check

minebender-game@1.0.0.0 · solver.bend:76

import minebender-game@1.0.0.0/solver.bend as Solver
import Base
import minebender-game@1.0.0.0/types.bend as T
import minebender-game@1.0.0.0/board.bend as B

76# The layout is consistent with what the player knows.
77def check(ctx: Ctx, +layout: T.Grid(Bool)) -> Bool:
78  match ctx:
79    case Ctx{+w, +h, n, rows, items}:
80      B.shaped(Bool, w, h, layout) && B.shaped(T.Seen, w, h, rows)
81        && Nat.is_eq(B.total_mines(layout), n) && items_ok(items, layout)

Uses (9)

Used by (24)