multiple_random_choice library
A library for generating a multiple random choice from an iterable. Inspired by dart_random_choice
Functions
-
randomMultipleChoice<
T> (Iterable< T> options, int choiceCount, Random? random) → Set<T> - generate multiple random choice under equally probability from options choiceCount: num of choosing objects random: your favorite Random instance (optionally)
-
randomMultipleWeightedChoice<
T> (Map< T, num> optionToWeightMap, int choiceCount, Random? random) → Set<T> - generate multiple random choice with weight from options optionToWeightMap: key->option, value->weight choiceCount: num of choosing objects random: your favorite Random instance (optionally)