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
- Registered by Alex Parrill
- ~master released 8 years ago
- ColonelThirtyTwo/d-pcg
- github.com/ColonelThirtyTwo/d-pcg
- Apache-2.0
- Copyright © 2016, Alex Parrill
- Authors:
- Dependencies:
- none
- Versions:
-
0.1.0 2016-Feb-21 ~master 2016-Feb-21 - 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