fisher-yates-shuffle-maxent
v1.0.0
Published
This package is a simple implementation of the Fisher Yates Shuffle algorithm. It is a simple and efficient algorithm to shuffle a list of elements.
Downloads
2
Readme
Fisher Yates Shuffle package
This package is a simple implementation of the Fisher Yates Shuffle algorithm. It is a simple and efficient algorithm to shuffle a list of elements.
Installation
npm install fisher-yates-shuffle
or
yarn add fisher-yates-shuffle
or
pnpm add fisher-yates-shuffle
Usage
CommonJS
const shuffle = require("fisher-yates-shuffle");
const list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
const shuffledList = shuffle(list);
ES6
import { FisherYates } from "fisher-yates-shuffle";
const list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
const shuffledList = FisherYates(list);