Reference · Rules, tiles and records
mayTradeThisTurnfunction
ONE TRADE A TURN. John, 2026-09-29, after a player traded over and over and built up a hand: "if they swap tiles … give them a chance to lay some tiles but cannot ask for another swap until next turn." A trade gives one tile and takes three, so trading without end lets one player take the bag from the others. After a trade the player may still lay, lift and draw, and press Done; the next trade is on their next turn.
Import it
import { mayTradeThisTurn } from "@johnmorrisdotca/kumimoji";
Definition
function mayTradeThisTurn(game: PartyGame): boolean
Parameters
| Name | Type | Description |
|---|---|---|
game | PartyGame | The current immutable shared-bag party game. |
Returns
boolean
ONE TRADE A TURN. John, 2026-09-29, after a player traded over and over and built up a hand: "if they swap tiles … give them a chance to lay some tiles but cannot ask for another swap until next turn." A trade gives one tile and takes three, so trading without end lets one player take the bag from the others. After a trade the player may still lay, lift and draw, and press Done; the next trade is on their next turn.
Examples
import { mayTradeThisTurn, startParty } from "@johnmorrisdotca/kumimoji";
const settings = {size:3,level:"hard",seed:44,gameLength:"short",language:"english",doubleSet:false,diagonals:false,hints:false} as const;
const bag = "catdogsun";
const game = startParty(settings,bag,["Seat 1","Seat 2"]);
console.log(mayTradeThisTurn(game));trueWhat it prints (run when this page was built)