Help for this page

Select Code to Download


  1. or download this
    my %cardvals;
    %cardvals{ @hand[0..4]<num> }++
    
  2. or download this
    # [234] of a kind
    $score += [*]($_,$_-1) for %cardvals.values;
    
  3. or download this
    # Fifteens
    if any( @hand<val> ) ~~ 5 && any( @hand<val> ) ~~ 10 {
    ...
            ( grep -> $_<val> ~~ 5, @hand ) *
            ( grep -> $_<val> ~~ 10, @hand );
    }
    
  4. or download this
    # Runs
    SPAN: for 5 .. 3 -> $span {
    ...
            }
        }
    }
    
  5. or download this
    Hand = 2,3,3,4 5
    
    2,3,4,5 = 4 points
    2,3,4,5 = 4 points
            = 8 points total