Reference · Tiles, Mexican Train and replay
fitsfunction
Whether a tile has this number at either end, so it can be laid against it.
Import it
import { fits } from "@johnmorrisdotca/domino";
Definition
function fits(tile: Domino, end: number): boolean
Parameters
| Name | Type | Description |
|---|---|---|
tile | number | A canonical tile number: low * 16 + high. |
end | number | The pip value the next laid tile must match. |
Returns
boolean
Whether a tile has this number at either end, so it can be laid against it.
Examples
import { fits, tileOf } from "@johnmorrisdotca/domino";
console.log(fits(tileOf(6,4),4));trueWhat it prints (run when this page was built)