Reference · Rules, tiles and records
placeFromHandfunction
A tile from the hand onto an empty square.
Import it
import { placeFromHand } from "@johnmorrisdotca/kumimoji";
Definition
function placeFromHand(play: TilePlay, handAt: number, square: string): TilePlay
Parameters
| Name | Type | Description |
|---|---|---|
play | TilePlay | The current immutable solo-game progress. |
handAt | number | The zero-based index of a tile in hand. |
square | string | The row,column square name. |
Returns
TilePlay
A tile from the hand onto an empty square.
Examples
import { deal, placeFromHand } from "@johnmorrisdotca/kumimoji";
const tiles = new Map([["0,0","c"],["0,1","a"],["0,2","t"]]);
const play = deal("catdog",3);
console.log(placeFromHand(play,0,"0,0").tiles.size);1What it prints (run when this page was built)