Shuffle lists based on Fisher-Yates shuffle algorithm
Shufflr is available for Rust as crates.io package and for JavaScript as NPM package.
To use shufflr in your project simply follow this steps:
Add shufflr to your Cargo.toml:
[dependencies]
shufflr = "0.1.0"
Import shufflr in your Rust code:
use shufflr::shuffle;
Use shuffle method with an array to get a copy of it shuffled:
let shuffled_array = shuffle(&original_array);
Install shufflr (trying to cover all package manager nowadays):
npm i shufflr
Or:
pnpm add shufflr
Or:
yarn add shufflr
Or:
bun add shufflr
Import shufflr in your JavaScript code:
var shufflr = require('shufflr');
Or:
import { shuffle } from 'shufflr';
Use shuffle method with an array to get a copy of it shuffled:
var shuffledArray = shufflr.shuffle(originalArray)
Or:
var shuffledArray = shuffle(originalArray)
After cloning the repository, build the project with:
cargo build
To run shufflr tests simply run:
cargo test
After cloning the repository, install the dev dependencies (shufflr does not have runtime dependencies):
npm install
To run shufflr tests simply run:
npm run test
If you like this project (or any other) and want to help me contiue to improve it or create new ones, check my Ko-fi profile and consider buying me a Speciality Coffee: