Reference · SVG faces and looks
redFiveIndexesfunction
WHICH TILES OF A LIST ARE THE RED FIVES. A set holds one red five of each suit, drawn in place of one of its four fives, and a face's letter cannot say which, so the first five of each suit in the list (in the layout's slot order, or the hand's) is the red one. A pure function of the tiles, so the same tiles are red every time.
Import it
import { redFiveIndexes } from "@johnmorrisdotca/jarajara/faces";
Definition
function redFiveIndexes(codes: Iterable<string>): Set<number>
Parameters
| Name | Type | Description |
|---|---|---|
codes | Iterable<string> | The tile face codes in current order. |
Returns
Set<number>
WHICH TILES OF A LIST ARE THE RED FIVES. A set holds one red five of each suit, drawn in place of one of its four fives, and a face's letter cannot say which, so the first five of each suit in the list (in the layout's slot order, or the hand's) is the red one. A pure function of the tiles, so the same tiles are red every time.
Examples
import { redFiveIndexes } from "@johnmorrisdotca/jarajara/faces";
console.log([...redFiveIndexes(["e","e","n"])]);[ 0, 2 ]What it prints (run when this page was built)