Game.flags_shown: def of minebender-game@1.0.0.0 Import: import minebender-game@1.0.0.0/game.bend as Game Lines 585-591 of minebender-game@1.0.0.0/game.bend: https://jend.leeeet.dev/read.txt?path=minebender-game@1.0.0.0/game.bend&start_line=585&end_line=591 import Base import minebender-game@1.0.0.0/types.bend as T # How many flags the mine counter shows: the mines, less the flags placed. def flags_shown(+w: Nat, +h: Nat, +shown: T.Grid(Bool), flags: List<&2, T.Pos>) -> Nat: match flags: case Nil{}: 0n case +p <> t: Nat.add(Bool.pick(Nat, unrevealed(w, h, shown, p), 1n, 0n), flags_shown(w, h, shown, t)) Uses (8): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.pick https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.add https://jend.leeeet.dev/definition.txt?path=minebender-game@1.0.0.0/game.bend&name=unrevealed https://jend.leeeet.dev/definition.txt?path=minebender-game@1.0.0.0/types.bend&name=Grid https://jend.leeeet.dev/definition.txt?path=minebender-game@1.0.0.0/types.bend&name=Pos