0.2.0 • Published 6 years ago

fisher-yates-shuffle v0.2.0

Weekly downloads
7
License
MIT
Repository
github
Last release
6 years ago

Fisher-Yates Shuffle Build Status

A JavaScript implementation of the Fisher-Yates Shuffle algorithm.

Requirements

  • NodeJS 6+

Installation

npm install fisher-yates-shuffle --save

Usage

const shuffle = require('fisher-yates-shuffle');
const deck = ['a', 'b', 'c', 'd'];
const shuffledDeck = shuffle(deck);
const randomizer = function() {
    return 0.321
};
const shuffle = require('fisher-yates-shuffe');
const deck = ['a', 'b', 'c', 'd'];
const shuffledDeck = shuffle(deck, randomizer);

Notes

  • It clones the given Array, so if it's rather large, make sure you have enough memory allocated.
  • This library is still rather naïve and could be improved. If you have any suggestions, please open up an Issue or a Pull Request.
0.2.0

6 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago

1.0.0

9 years ago