DRandom: Quick and dirty Dart RNG

I needed a quick and dirty RNG for some code prototype Dart code. This code was based off of Random.cs from the mono project. In the mono projects comments that code is based on some example in the numerical recipes in C book. Methods provided are simple enough to understand based on the their names. I would not trust this code for any serious random number generations and it is best to seed the RNG then letting the default seed be used. Get the DRandom from github.

class DRandom
DRandom.withSeed(int Seed)
double Sample()
int Next()
int NextFromMax(int maxValue)
int NextFromRange(int minValue, int maxValue)
List NextInts(int size)
Map NextIntsUnique(int minValue, int maxValue, int size)
double NextDouble()


About financecoding
I enjoy coding in dart.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: