PseudoRandomNumberGenerator Code
Brought to you by:
ark219
File | Date | Author | Commit |
---|---|---|---|
src | 2018-05-14 |
![]() |
[85f691] Add Readme |
tests | 2019-03-06 |
![]() |
[bee2aa] Update PHPUnit |
.gitignore | 2018-05-11 |
![]() |
[4c205a] Add PHPUnit |
README.md | 2018-05-14 |
![]() |
[85f691] Add Readme |
composer.json | 2018-05-14 |
![]() |
[85f691] Add Readme |
phpunit.xml | 2018-05-11 |
![]() |
[4c205a] Add PHPUnit |
This library includes the set of topic for use in different cases.
Get static function from a class which return a Closure. Use this closure in the same way as rand()
or mt_rand
function.
$cards = [];
$cardsLeftToPlace = 52;
$randFunction = \Knowgod\PRNG\LinearCongruentialGenerator::msvcrt_rand($gamenumber);
for ($i = 0; $i < 52; ++$i) {
$cards[ $i ] = $randFunction() % $cardsLeftToPlace--;
}