Description

D port of the PCG PRNG

Package Information

Version0.1.0 (2016-Feb-21)
Homepagehttps://github.com/ColonelThirtyTwo/d-pcg
Repositoryhttps://github.com/ColonelThirtyTwo/d-pcg
LicenseApache-2.0
CopyrightCopyright © 2016, Alex Parrill
AuthorsAlex Parrill, M.E. O'Neill
Registered byAlex Parrill
Dependenciesnone

Installation

To use this package, put the following dependency into your project's dependencies section:

dub.json
dub.sdl

Readme

D-PCG

The PCG psuedorandom number generator ported to D.

Based off of the complete C++ library, though D-isms are used where practical and some features are missing.

The RNGs provided fulfill the contracts specified by std.random; that is, std.random.isUniformRNG!PCG32 == true, and thus the random number functions in std.random can (and should) be used.

Example usage:

import std.stdio;
import std.random;
import pcg;

void main() {
	auto rng = PCG32(unpredictableSeed);
	foreach(i; 1..20) {
		writeln("Random number: ", uniform(1, 6, rng));
	}
}

For the complete API, generate documentation using dub build -d doc

Available versions

0.1.0 ~master