Help for this page

Select Code to Download


  1. or download this
    my @random_numbers;
    push(@random_numbers, int(rand(54)) + 1)
    ...
          sort { $a->[1] <=> $b[1] || $a->[0] <=> $b[0] }
             map { [ $_, $counts{$_} ] }
                keys(%counts);
    
  2. or download this
    # Picks 6 unique numbers uniformly between 1 and 54 inclusive.
    sub pick6 {
    ...
          sort { $a->[1] <=> $b[1] || $a->[0] <=> $b[0] }
             map { [ $_, $counts{$_} ] }
                keys(%counts);