drandom 0.0.3 copy "drandom: ^0.0.3" to clipboard
drandom: ^0.0.3 copied to clipboard

Dart 1 only

Alternative pseudorandom random number generator for dart based on a similar implementation in mono/C#

example/drandom_example.dart

import 'package:drandom/drandom.dart';

void main()
{
    var DRandomNoSeed = new DRandom();
    var DRandomSeed = new DRandom.withSeed(new DateTime.now().millisecondsSinceEpoch%2147483647);

    print('With no seed');
    int i=10;
    while(i-->0)
    {
        print(DRandomNoSeed.Next());
    }

    print('With seed');
    i=10;
    while(i-->0)
    {
        print(DRandomSeed.Next());
    }

     print(DRandomSeed.NextFromMax(10));
     print(DRandomSeed.NextDouble());

     var m = DRandomSeed.NextIntsUnique(0,20,19);
     print(m);
     m.forEach((k,v) => print('${k},${v}'));
}
0
likes
30
points
19
downloads

Publisher

unverified uploader

Weekly Downloads

Alternative pseudorandom random number generator for dart based on a similar implementation in mono/C#

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

unittest

More

Packages that depend on drandom