Reference · Mazes, arrows and mixed boards
ArrowTaptype
What a tap did.
Import it
import type { ArrowTap } from "@johnmorrisdotca/meikyuu";
Definition
type ArrowTap = {
readonly game: ArrowGame;
readonly result: "removed" | "blocked" | "locked" | "ignored";
readonly by?: number;
};
Members
| Name | Type | Description |
|---|---|---|
game | ArrowGame | |
result | "removed" | "blocked" | "locked" | "ignored" | |
by (optional) | number | undefined | The arrow in the way, for |
Examples
import type { ArrowRecipe, ArrowTap } 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)!;
const value: ArrowTap = tapArrow(arrowGame,arrowId);
console.log(value);{
game: {
board: {
recipe: [Object],
w: 5,
h: 5,
inShape: [Array],
arrows: [Array],
locked: [Array]
},
present: [
true, true, true,
true, true, true,
true, true, true,
true, true, true,
false
],
hearts: 3,
heartsAtStart: 3,
unlocked: true,
status: 'playing',
taken: [ 12 ],
mistakes: 0
},
result: 'removed'
}What it prints (run when this page was built)