def loop

minebender-game@1.0.0.0 · solver.bend:516

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

516# The first cell of hs that no consistent layout mines, given layouts
517# `found` already shown consistent.
518def loop(hs: List<&2, T.Pos>, +found: List<&2, T.Grid(Bool)>, +pl: Plan,
519  +part: T.Grid(Maybe<&2, Bool>), +ctx: Ctx) -> Maybe<&2, T.Pos>:
520  match hs:
521    case Nil{}:
522      None{}
523    case +c <> +t:
524      loop.if(covered(found, c),
525        u => loop(t, found, pl, part, ctx),
526        v => loop.found(search(c, pl, part, ctx), c,
527          l => loop(t, l <> found, pl, part, ctx)))

Uses (11)

Used by (7)