daily pastebin goal
36%
SHARE
TWEET

[Perl 6] Sampling from a Mix.

cwchen Nov 8th, 2017 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. my $mix = (1 => 0.8, 2 => 0.1, 3 => 0.05, 4 => 0.02, 5 => 0.01).Mix;
  2.  
  3. loop (my $i = 0; $i < 10; $i++) {
  4.     $mix.roll(10).sort.say;
  5. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top