Reference · Rules, tiles and records
dealfunction
The opening hand: the first handSize tiles of the bag, and an empty table.
Import it
import { deal } from "@johnmorrisdotca/kumimoji";
Definition
function deal(bag: string, handSize: number): TilePlay
Parameters
| Name | Type | Description |
|---|---|---|
bag | string | The original bag in draw order. |
handSize | number | The initial number of tiles to draw. |
Returns
TilePlay
The opening hand: the first handSize tiles of the bag, and an empty table.
Examples
import { deal } from "@johnmorrisdotca/kumimoji";
console.log(deal("catdog",3));{
bag: 'catdog',
returned: '',
taken: 3,
tiles: Map(0) {},
hand: [ 'c', 'a', 't' ]
}What it prints (run when this page was built)