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.1.13 tracks/perl6/exercises/scrabble-score/example.yaml
trackler-2.2.1.12 tracks/perl6/exercises/scrabble-score/example.yaml
trackler-2.2.1.11 tracks/perl6/exercises/scrabble-score/example.yaml
trackler-2.2.1.10 tracks/perl6/exercises/scrabble-score/example.yaml
trackler-2.2.1.9 tracks/perl6/exercises/scrabble-score/example.yaml
trackler-2.2.1.8 tracks/perl6/exercises/scrabble-score/example.yaml
trackler-2.2.1.7 tracks/perl6/exercises/scrabble-score/example.yaml
trackler-2.2.1.6 tracks/perl6/exercises/scrabble-score/example.yaml
trackler-2.2.1.5 tracks/perl6/exercises/scrabble-score/example.yaml
trackler-2.2.1.4 tracks/perl6/exercises/scrabble-score/example.yaml
trackler-2.2.1.3 tracks/perl6/exercises/scrabble-score/example.yaml
trackler-2.2.1.2 tracks/perl6/exercises/scrabble-score/example.yaml
trackler-2.2.1.1 tracks/perl6/exercises/scrabble-score/example.yaml
trackler-2.2.1.0 tracks/perl6/exercises/scrabble-score/example.yaml
trackler-2.2.0.6 tracks/perl6/exercises/scrabble-score/example.yaml
trackler-2.2.0.5 tracks/perl6/exercises/scrabble-score/example.yaml
trackler-2.2.0.4 tracks/perl6/exercises/scrabble-score/example.yaml
trackler-2.2.0.3 tracks/perl6/exercises/scrabble-score/example.yaml
trackler-2.2.0.2 tracks/perl6/exercises/scrabble-score/example.yaml
trackler-2.2.0.1 tracks/perl6/exercises/scrabble-score/example.yaml