Reference · Mazes, arrows and mixed boards
blockedByfunction
The arrows on the way out of id that are still on the board.
Import it
import { blockedBy } from "@johnmorrisdotca/meikyuu";
Definition
function blockedBy(game: ArrowGame, id: number): number[]
Parameters
| Name | Type | Description |
|---|---|---|
game | ArrowGame | The current immutable native game state. |
id | number | The zero-based arrow index. |
Returns
number[]
The arrows on the way out of id that are still on the board.
Examples
import type { ArrowRecipe } from "@johnmorrisdotca/meikyuu";
import { blockedBy, hintArrow, makeArrows, newArrowGame } from "@johnmorrisdotca/meikyuu";
const arrowRecipe: ArrowRecipe = {shape:"square",w:5,h:5,longest:3,seed:42};
const arrows = makeArrows(arrowRecipe);
const arrowGame = newArrowGame(arrows);
const arrowId = hintArrow(arrowGame)!;
console.log(blockedBy(arrowGame,arrowId));[]What it prints (run when this page was built)