Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use v6;
- multi sub infix:<D> ($lhs, $rhs) {
- my $sum = 0;
- $sum += $rhs.rand.Int for 1..$lhs;
- return $sum;
- }
- multi sub infix:<D> ($lhs, $rhs where {$_ == 6} ) {
- return &infix:<D>.candidates[0]($lhs, $rhs) + $lhs;
- }
- my ($m, $n) = @*ARGS;
- say ($m D 6) + ($n D 10);
Add Comment
Please, Sign In to add comment