DRandom: Quick and dirty Dart RNG
October 26, 2011 Leave a comment
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.
int NextFromMax(int maxValue)
int NextFromRange(int minValue, int maxValue)
List NextInts(int size)
Map NextIntsUnique(int minValue, int maxValue, int size)