Skip to content

Instantly share code, notes, and snippets.

@lyntco
Last active August 29, 2015 14:07
Show Gist options
  • Save lyntco/9bb4a4a43114f5e2ca3a to your computer and use it in GitHub Desktop.
Save lyntco/9bb4a4a43114f5e2ca3a to your computer and use it in GitHub Desktop.
Quiz-5 Scrabble

Quiz-5 Scrabble Score

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

Scrabble.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