Skip to content

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

License

Notifications You must be signed in to change notification settings

JonathanMCarter/Alea-CSharp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Topics

Resources

License

Stars

Watchers

Forks

Languages