a small library implementing methods to sample items from collections
A simple usage example:
void deal(int n, List<String> items, {required bool unique}) {
stdout.writeln("Picking $n from $items (unique: $unique)\n");
if (n == 1) {
stdout.writeln("Selected item: ${CollectionSampler().pick(items)}");
} else {
stdout.writeln(
"Selected items: ${CollectionSampler().pickN(items, n, unique: unique)}",
);
}
}
Please file feature requests and bugs at the issue tracker.