def safe_list

minebender-game@1.0.0.0 · game.bend:443

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

443# Where the assist looks for a safe cell, k being a random number: first
444# the hidden cells next to a revealed one, then every cell, each from a
445# random point; last every cell in order, which never comes into play but
446# lets the proofs see a safe cell is always found.
447def safe_list(+w: Nat, +h: Nat, +shown: T.Grid(Bool), +k: Nat) -> List<&2, T.Pos>:
448  +cs = B.cells(w, h)
449  List.append(&2, T.Pos, turn(edges(w, h, shown, cs), k), List.append(&2, T.Pos, turn(cs, k), cs))

Uses (9)

Used by (5)