diff --git a/exercises/practice/scrabble-score/.meta/src/example.cr b/exercises/practice/scrabble-score/.meta/src/example.cr index c66edb3f..664f2b13 100644 --- a/exercises/practice/scrabble-score/.meta/src/example.cr +++ b/exercises/practice/scrabble-score/.meta/src/example.cr @@ -1,7 +1,7 @@ module ScrabbleScore extend self - @@scores = { + SCORES = { 'A' => 1, 'E' => 1, 'I' => 1, 'O' => 1, 'U' => 1, 'L' => 1, 'N' => 1, 'R' => 1, 'S' => 1, 'T' => 1, 'D' => 2, 'G' => 2, 'B' => 3, 'C' => 3, 'M' => 3, 'P' => 3, 'F' => 4, 'H' => 4, @@ -10,6 +10,6 @@ module ScrabbleScore } of Char => Int32 def score(word : String) : Int32 - word.upcase.chars.map { |c| @@scores[c] }.sum(0) + word.upcase.chars.map { |c| SCORES[c] }.sum end end