d-pcg ~master

D port of the PCG PRNG


To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

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

Authors:
  • Alex Parrill
  • M.E. O'Neill
Dependencies:
none
Versions:
0.1.0 2016-Feb-21
~master 2016-Feb-21
Show all 2 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 0 downloads this month

  • 57 downloads total

Score:
1.0
Short URL:
d-pcg.dub.pm