def touching

minebender-game@1.0.0.0 · LAWS.bend:71

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

71# The cells of qs adjacent to p, in the order of qs.
72def touching(+p: T.Pos, qs: List<&2, T.Pos>) -> List<&2, T.Pos>:
73  match qs:
74    case Nil{}:
75      Nil{}
76    case +q <> t:
77      List.filter.put(T.Pos, q, touching(p, t), adjacent(p, q))

Uses (4)

Used by (3)