dropTargetfunction
Where a stone dropped into col lands, or null when the column is full.
Import it
import { dropTarget } from "@johnmorrisdotca/narabe";
Definition
function dropTarget(board: Cell[], size: number, col: number): Point | null
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. |
col | number | The zero-based column. |
Returns
Point | null
The landing point, or null when that column has no landing cell.
Examples
import { createGame, dropTarget } from "@johnmorrisdotca/narabe";
const drop = createGame({variant:"dropFour"});
console.log(dropTarget(drop.board,drop.settings.size,0));{ row: 6, col: 0 }What it prints (run when this page was built)