Reference · Mazes, arrows and mixed boards
tapArrowfunction
Attempt to remove a native arrow and return the new game and removed/blocked/locked/ignored result.
Import it
import { tapArrow } from "@johnmorrisdotca/meikyuu";
Definition
function tapArrow(game: ArrowGame, id: number): ArrowTap
Parameters
| Name | Type | Description |
|---|---|---|
game | ArrowGame | The current immutable native game state. |
id | number | The zero-based arrow index. |
Returns
ArrowTap
Attempt to remove a native arrow and return the new game and removed/blocked/locked/ignored result.
Examples
import type { ArrowRecipe } from "@johnmorrisdotca/meikyuu";
import { hintArrow, makeArrows, newArrowGame, tapArrow } 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(tapArrow(arrowGame,arrowId).result);removedWhat it prints (run when this page was built)