Guest User

Untitled

a guest
Jan 23rd, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. use v6;
  2.  
  3. multi sub infix:<D> ($lhs, $rhs) {
  4. my $sum = 0;
  5. $sum += $rhs.rand.Int for 1..$lhs;
  6. return $sum;
  7. }
  8.  
  9. multi sub infix:<D> ($lhs, $rhs where {$_ == 6} ) {
  10. return &infix:<D>.candidates[0]($lhs, $rhs) + $lhs;
  11. }
  12.  
  13. my ($m, $n) = @*ARGS;
  14. say ($m D 6) + ($n D 10);
Add Comment
Please, Sign In to add comment