Skip to the content

Kazu数

Generate checked Sudoku and logic puzzles, read native rules and hints, and draw or embed playable boards.

Kazu is the Japanese word 数 for number. About the name

Contents

Reference · Number-puzzle engines

shuffledfunction

A copy of the list in a random order (Fisher–Yates, from the end); the list given is left alone.

Import it

import { shuffled } from "@johnmorrisdotca/kazu";

Definition

function shuffled<T>(items: readonly T[], random: Random): T[]

Parameters

NameTypeDescription
itemsreadonly T[]

Items to copy and shuffle.

randomRandom

A random source returning values in [0,1).

Returns

T[]

A copy of the list in a random order (Fisher–Yates, from the end); the list given is left alone.

Examples

import { seededRandom, shuffled } from "@johnmorrisdotca/kazu";

console.log(shuffled(["A","B","C"],seededRandom(42)));
[ 'C', 'A', 'B' ]

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/kazu 2.1.0.