Every cell the walk predicate accepts, row by row.
Board to scan.
Which cells count as open.
Coordinates that can be entered.
import { listOpenCells, walkableUnlessTypes } from "@tamb/gamegrid/npc";const matrix = [ [{ type: "wall" }, { type: "floor" }], [{ type: "floor" }, { type: "water" }],];const open = listOpenCells(matrix, walkableUnlessTypes(["wall", "water"]));// [[1, 0], [0, 1]] Copy
import { listOpenCells, walkableUnlessTypes } from "@tamb/gamegrid/npc";const matrix = [ [{ type: "wall" }, { type: "floor" }], [{ type: "floor" }, { type: "water" }],];const open = listOpenCells(matrix, walkableUnlessTypes(["wall", "water"]));// [[1, 0], [0, 1]]
Every cell the walk predicate accepts, row by row.