def agrees
import minebender-game@1.0.0.0/LAWS.bend as LAWSimport Base
import minebender-game@1.0.0.0/types.bend as T
147# What the player sees at p agrees with the layout.
148def agrees(w: Nat, h: Nat, +layout: T.Grid(Bool), +p: T.Pos, s: T.Seen) -> Bool:
149 match s:
150 case T.Hidden{}:
151 True{}
152 case T.Shown{k}:
153 Bool.not(mine(layout, p)) && Nat.is_eq(adj_mines(w, h, layout, p), k)
154 case T.Boom{}:
155 mine(layout, p)