layOfffunction
The defender's side of a knock: their own melds first, then every card left that fits one of the knocker's melds laid off onto it — a run grown one card at a time, so a six can follow the five just laid.
Import it
import { layOff } from "@johnmorrisdotca/toranpu/gin-rummy";
Definition
function layOff(defender: readonly CardId[], knockerMelds: readonly GinMeld[]): { layout: GinLayout; laidOff: CardId[]; melds: GinMeld[]; }
Parameters
| Name | Type | Description |
|---|---|---|
defender | readonly string[] | The defending player’s hand or melds. |
knockerMelds | readonly GinMeld[] | The knocking player’s declared melds. |
Returns
{ layout: GinLayout; laidOff: CardId[]; melds: GinMeld[]; }
The defender's side of a knock: their own melds first, then every card left that fits one of the knocker's melds laid off onto it — a run grown one card at a time, so a six can follow the five just laid.
Examples
import { layOff } from "@johnmorrisdotca/toranpu/gin-rummy";
console.log(layOff(["6H", "AS"], [["3H", "4H", "5H"]]));{
layout: { melds: [], deadwood: [ 'AS' ] },
laidOff: [ '6H' ],
melds: [ [ '3H', '4H', '5H', '6H' ] ]
}What it prints (run when this page was built)