Random posts about coding

Mostly blogging about dart.

DRandom: Quick and Dirty Dart RNG

| Comments

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) DRandom() 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() }