Sha256: 0079e23d670ebf2e19bac2fcbf70e682bd9742edf9d8689d0399ba1fa4ed4ab0

Contents?: true

Size: 747 Bytes

Versions: 82

Compression:

Stored size: 747 Bytes

Contents

exercise: Scrabble
version: 1
plan: 13
imports: '&score'
tests: |
  is .<input>.&score, |.<expected description> for @($c-data<cases>);

unit: module
example: |
  sub score (Str:D $word --> Int:D) is export {
    my $score = 0;
    for $word.lc.split('',:skip-empty) -> $letter {
      given $letter {
        when * ~~ /<[aeioulnrst]>/ { $score += 1  }
        when * ~~ /<[dg]>/         { $score += 2  }
        when * ~~ /<[bcmp]>/       { $score += 3  }
        when * ~~ /<[fhvwy]>/      { $score += 4  }
        when * ~~ /k/              { $score += 5  }
        when * ~~ /<[jx]>/         { $score += 8  }
        when * ~~ /<[qz]>/         { $score += 10 }
      }
    }
    return $score;
  }
stub: |
  sub score ($word) is export {
  }

Version data entries

82 entries across 82 versions & 1 rubygems

Version Path
trackler-2.2.0.0 tracks/perl6/exercises/scrabble-score/example.yaml
trackler-2.1.0.55 tracks/perl6/exercises/scrabble-score/example.yaml
trackler-2.1.0.54 tracks/perl6/exercises/scrabble-score/example.yaml
trackler-2.1.0.53 tracks/perl6/exercises/scrabble-score/example.yaml
trackler-2.1.0.52 tracks/perl6/exercises/scrabble-score/example.yaml
trackler-2.1.0.51 tracks/perl6/exercises/scrabble-score/example.yaml
trackler-2.1.0.50 tracks/perl6/exercises/scrabble-score/example.yaml
trackler-2.1.0.49 tracks/perl6/exercises/scrabble-score/example.yaml
trackler-2.1.0.48 tracks/perl6/exercises/scrabble-score/example.yaml
trackler-2.1.0.47 tracks/perl6/exercises/scrabble-score/example.yaml
trackler-2.1.0.46 tracks/perl6/exercises/scrabble-score/example.yaml
trackler-2.1.0.45 tracks/perl6/exercises/scrabble-score/example.yaml
trackler-2.1.0.44 tracks/perl6/exercises/scrabble-score/example.yaml
trackler-2.1.0.43 tracks/perl6/exercises/scrabble-score/example.yaml
trackler-2.1.0.42 tracks/perl6/exercises/scrabble-score/example.yaml
trackler-2.1.0.41 tracks/perl6/exercises/scrabble-score/example.yaml
trackler-2.1.0.40 tracks/perl6/exercises/scrabble-score/example.yaml
trackler-2.1.0.39 tracks/perl6/exercises/scrabble-score/example.yaml
trackler-2.1.0.38 tracks/perl6/exercises/scrabble-score/example.yaml
trackler-2.1.0.37 tracks/perl6/exercises/scrabble-score/example.yaml