Reference · Mazes, arrows and mixed boards
pickfunction
One of the items, chosen from the stream.
Import it
import { pick } from "@johnmorrisdotca/meikyuu";
Definition
function pick<T>(items: readonly T[], random: Random): T
Parameters
| Name | Type | Description |
|---|---|---|
items | readonly T[] | Items to pick from or copy/shuffle. |
random | Random | A random source returning values in [0,1). |
Returns
T
One of the items, chosen from the stream.
Examples
import { pick, seededRandom } from "@johnmorrisdotca/meikyuu";
console.log(pick(["A","B","C"],seededRandom(42)));BWhat it prints (run when this page was built)