1.1.1 • Published 7 years ago

shuffle-matrix v1.1.1

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

Shuffle-Matrix

npm

A JavaScript implementation of the Fisher-Yates Shuffle algorithm for array and matrix.

Requirements

  • Node.js 6+

Installation

npm install shuffle-matrix --save

Usage

let shuffle = require('shuffle-matrix');
let origin = [1 , 2 , 3 , 4 , 5 , 6 ,  7 , 8 , 9];
let result = shuffle(origin);
let randomFunc = function() {
    return 0.618
};
let shuffle = require('shuffle-matrix');
let origin = ['a', 'b', 'c', 'd', 'e', 'f'];
let result = shuffle(origin, randomFunc);
let shuffle = require('shuffle-matrix');
let origin = [
    [0, 1],
    2,
    [3, 4, 5, 6, 7],
    [8, 9, 10],
    11,
    [12, 13]
];
let result = shuffle(origin);
1.1.1

7 years ago

1.1.0

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago