Skip to content

rjmcguire/d-pcg

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

PCG PRNG port for D

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • D 100.0%