Skip to content

Instantly share code, notes, and snippets.

@codebubb
Last active October 23, 2023 08:18
Show Gist options
  • Save codebubb/ada79a158b417793d18564ba18e1b89b to your computer and use it in GitHub Desktop.
Save codebubb/ada79a158b417793d18564ba18e1b89b to your computer and use it in GitHub Desktop.
JavaScript Exercises: Exercise 01

JavaScript Exercises: Exercise 01

Scrabble Score

Scrabble is a word game where players score points for making words on a tiled board.

The amount a player scores for a word depends on what letters they use in their word.

Your goal for this exercise is to work out the Scrabble score for a player's word.

Your code should return the number of points for a particular word provided.

For example:

'Code' has the value of 7 (C = 3, O = 1, D = 2, E = 1)

The scrabble scores are as follows (from Wikipedia):

  • 1 point: E, A, I, O, N, R, T, L, S, U
  • 2 points: D, G
  • 3 points: B, C, M, P
  • 4 points: F, H, V, W, Y
  • 5 points: K
  • 8 points: J, X
  • 10 points: Q, Z
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment