landingPointsfunction
The one landing cell per column with room: the only cells a drop can fill.
Import it
import { landingPoints } from "@johnmorrisdotca/narabe";
Definition
function landingPoints(board: Cell[], size: number): Point[]
Parameters
| Name | Type | Description |
|---|---|---|
board | Cell[] | The row-major board cells; null marks an empty point. |
size | number | The number of cells on each side of the board. |
Returns
Point[]
The one landing cell per column with room: the only cells a drop can fill.
Examples
import { createGame, landingPoints } from "@johnmorrisdotca/narabe";
const drop = createGame({variant:"dropFour"});
console.log(landingPoints(drop.board,drop.settings.size));[
{ row: 6, col: 0 },
{ row: 6, col: 1 },
{ row: 6, col: 2 },
{ row: 6, col: 3 },
{ row: 6, col: 4 },
{ row: 6, col: 5 },
{ row: 6, col: 6 }
]What it prints (run when this page was built)