Reference · Tiles, layouts and deals
MatchesOftype
Which tile Find would show for a slot: the ones that could be taken with it now, and the ones that match but are held.
Import it
import type { MatchesOf } from "@johnmorrisdotca/jarajara";
Definition
type MatchesOf = {
free: number[];
blocked: number[];
};
Members
| Name | Type | Description |
|---|---|---|
free | number[] | The slots that match the tile and could be taken with it now: both are free. Empty when the tile itself is held. |
blocked | number[] | The other slots that match it: held by a tile on top or on both sides (or, when the tile itself is held, every match). |
Examples
import { generateAwase } from "@johnmorrisdotca/jarajara/awase";
import { freePairs, geometryOf, layoutFor, matchesOf } from "@johnmorrisdotca/jarajara";
import type { MatchesOf } from "@johnmorrisdotca/jarajara";
const deal = generateAwase(4,"easy",2026);
const layout = layoutFor(4)!;
const geometry = geometryOf(layout);
const cells = deal.givens;
const pair = freePairs(geometry,cells,"group")[0];
const value: MatchesOf = matchesOf(geometry,cells,"group",pair[0]);
console.log(value);{ free: [ 7 ], blocked: [] }What it prints (run when this page was built)