Reference · Rules, tiles and records
tradefunction
One tile from the hand to the bottom of the bag, and the next three out of it.
Import it
import { trade } from "@johnmorrisdotca/kumimoji";
Definition
function trade(play: TilePlay, handAt: number): TilePlay
Parameters
| Name | Type | Description |
|---|---|---|
play | TilePlay | The current immutable solo-game progress. |
handAt | number | The zero-based index of a tile in hand. |
Returns
TilePlay
One tile from the hand to the bottom of the bag, and the next three out of it.
Examples
import { deal, trade } from "@johnmorrisdotca/kumimoji";
const play = deal("catdog",3);
console.log(trade(play,0).hand);[ 'a', 't', 'd', 'o', 'g' ]What it prints (run when this page was built)