2017 © Pedro Peláez
 

library priority-shuffle-random

Endroid Priority Shuffle Random

image

endroid/priority-shuffle-random

Endroid Priority Shuffle Random

  • Monday, April 16, 2018
  • by endroid
  • Repository
  • 1 Watchers
  • 2 Stars
  • 393 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 22 % Grown

The README.md

Priority Shuffle Random

By endroid, (*1)

Latest Stable Version Build Status Total Downloads Monthly Downloads License, (*2)

This library extends the basic random functionality by ensuring that the appearance of items is evenly distributed while respecting their priority. Items with priority 3 will be shown three times as often as items with priority 1, while the shuffle algorithm ensures that the values are spreaded nicely., (*3)

Installation

Use Composer to install the library., (*4)

``` bash $ composer require endroid/priority-shuffle-random, (*5)


## Usage ```php <?php use Endroid\PriorityShuffleRandom; $random = new PriorityShuffleRandom(); $random->add('A', 1); $random->add('B', 2); // Show B two times as often as the other items $random->add('C', 1); $random->add('D', 1); for ($i = 0; $i < 12; $i++) { echo $random->next(); } // Example output: CABDBDBACBAC

Versioning

Version numbers follow the MAJOR.MINOR.PATCH scheme. Backwards compatibility breaking changes will be kept to a minimum but be aware that these can occur. Lock your dependencies for production and test your code when upgrading., (*6)

License

This bundle is under the MIT license. For the full copyright and license information please view the LICENSE file that was distributed with this source code., (*7)

The Versions

16/04 2018

dev-master

9999999-dev https://github.com/endroid/priority-shuffle-random

Endroid Priority Shuffle Random

  Sources   Download

MIT

The Requires

 

The Development Requires

php endroid random priority shuffle

04/03 2018

2.0.1

2.0.1.0 https://github.com/endroid/priority-shuffle-random

Endroid Priority Shuffle Random

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

php endroid random priority shuffle

04/03 2018

2.0.0

2.0.0.0 https://github.com/endroid/priority-shuffle-random

Endroid Priority Shuffle Random

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

php endroid random priority shuffle

01/01 2017

1.0.2

1.0.2.0 https://github.com/endroid/PriorityShuffleRandom

Endroid Priority Shuffle Random

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

endroid random priority shuffle

01/01 2017

1.x-dev

1.9999999.9999999.9999999-dev https://github.com/endroid/PriorityShuffleRandom

Endroid Priority Shuffle Random

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

endroid random priority shuffle

01/01 2016

1.0.1

1.0.1.0 https://github.com/endroid/PriorityShuffleRandom

Endroid Priority Shuffle Random

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

endroid random priority shuffle

12/10 2015

1.0.0

1.0.0.0 https://github.com/endroid/PriorityShuffleRandom

Endroid Priority Shuffle Random

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

endroid random priority shuffle