Skip to content

Latest commit

 

History

History
24 lines (23 loc) · 1.01 KB

README.md

File metadata and controls

24 lines (23 loc) · 1.01 KB

Alea C#

A simple C# version of the Alea pseudo-random number generator (PRNG) originally created by Johannes Baagøe.

Conception

I pretty much made this for a work project where I was trying to work out a random number generator to use between systems in C# & Javascript. The results needed to be the same and I came across Alea. Though there was no C# implementation that I could find, so I made this.

I use this in my Unity code library here if you want an example intergration.

How to use

First make an instance of the Alea number generator. Its not static to be the most flexible as you can enter the seed into the constructor. An example below:

var alea = new Alea("MySeed");

To get a random number just call Alea.Random() from your instance to get a random number from the generator. An example below:

var alea = new Alea("MySeed");
var randomNumber = alea.Random();

Licence

MIT Licence