P24 - Draw N different random numbers from the set 1..M.

Author: Ryan Connelly

Example

> say lotto-select(6, 49);
37 8 32 15 21 46

Source code: P24-topo.pl

use v6;

sub lotto-select($n, $m)
{
    gather for ^$n
    {
        take (1 ... $m).pick(1).first;
    }
}

say "{lotto-select(6, 49)}";