Skip to content

Instantly share code, notes, and snippets.

@SoxFace
Forked from epoch/warmup_scrabble_quiz.md
Last active August 29, 2015 14:13
Show Gist options
  • Save SoxFace/8ff2f32c26015c123387 to your computer and use it in GitHub Desktop.
Save SoxFace/8ff2f32c26015c123387 to your computer and use it in GitHub Desktop.

Scrabble Score

Write a program that, given a word, computes the scrabble score for that word.

Scrabble.new.score("cabbage")
# => 14

Your program should be in a file named scrabble.rb.

Letter Values

Letter                           Value
A, E, I, O, U, L, N, R, S, T       1
D, G                               2
B, C, M, P                         3
F, H, V, W, Y                      4
K                                  5
J, X                               8
Q, Z                               10

Extensions

  • You can play a :double or a :triple letter.
  • You can play a :double or a :triple word.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment