Menu

Tree [bee2aa] master /
 History

HTTPS access


File Date Author Commit
 src 2018-05-14 Arkadij Kuzhel Arkadij Kuzhel [85f691] Add Readme
 tests 2019-03-06 Arkadij Kuzhel Arkadij Kuzhel [bee2aa] Update PHPUnit
 .gitignore 2018-05-11 Arkadij Kuzhel Arkadij Kuzhel [4c205a] Add PHPUnit
 README.md 2018-05-14 Arkadij Kuzhel Arkadij Kuzhel [85f691] Add Readme
 composer.json 2018-05-14 Arkadij Kuzhel Arkadij Kuzhel [85f691] Add Readme
 phpunit.xml 2018-05-11 Arkadij Kuzhel Arkadij Kuzhel [4c205a] Add PHPUnit

Read Me

Pseudo Random Number Generator

This library includes the set of topic for use in different cases.

Generators

  1. Linear congruential generator
    1. BSD version
    2. Microsoft version (this version was used for the Freecell solitaire game numbered deals)

Usage

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--;
        }
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.