dropTarget関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Where a stone dropped into col lands, or null when the column is full.
インポート
import { dropTarget } from "@johnmorrisdotca/narabe";
定義
function dropTarget(board: Cell[], size: number, col: number): Point | null
引数
| 名前 | 型 | 説明 |
|---|---|---|
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. |
戻り値
Point | null
The landing point, or null when that column has no landing cell.
例
import { createGame, dropTarget } from "@johnmorrisdotca/narabe";
const drop = createGame({variant:"dropFour"});
console.log(dropTarget(drop.board,drop.settings.size,0));{ row: 6, col: 0 }出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。