Reference · Options, materials, stacks and wear
StackLayoutOptionstype
How a stack is laid out: how messy, from which seed and how many cards deep.
Import it
import type { StackLayoutOptions } from "@johnmorrisdotca/fuda-cards";
Definition
interface StackLayoutOptions {
messiness?: number;
seed?: number;
depth?: number;
}
Members
| Name | Type | Description |
|---|---|---|
messiness (optional) | number | undefined | From 0 (squared up) to 1 (very messy). Unless said, 0.3. |
seed (optional) | number | undefined | The stack's own seed: the same seed lays the same stack the same way. Unless said, 1. |
depth (optional) | number | undefined | How many cards under the top one are laid out at most, so a stack of 52 costs no more than one of 11. Unless said, 10. |
Examples
import { stackLayout, type StackLayoutOptions } from "@johnmorrisdotca/fuda-cards";
const messy: StackLayoutOptions = { messiness: 0.8, seed: 7, depth: 5 };
console.log(stackLayout(52, messy).length); // 55What it prints (run when this page was built)