lifemeetscode/fisher-yates

A PHP implementation of the Fisher-Yates shuffle

v1.0.2 2018-01-07 20:13 UTC

This package is auto-updated.

Last update: 2024-04-07 15:02:43 UTC


README

A PHP implementation of the Fisher-Yates shuffle

Travis branch

Installing

Use Composer:

composer require lifemeetscode/fisher-yates

Usage

$itemsToShuffle = ['a', 'b', 'c', 'd', 'e'];

$fy = new FisherYates($itemsToShuffle);

$result = $fy->shuffle();