Skip to content

Latest commit

 

History

History
42 lines (27 loc) · 1.48 KB

exercise_2.md

File metadata and controls

42 lines (27 loc) · 1.48 KB

Unit 3 Practice

Exercise 2 - Max Scrabble Score

Create a dictionary that contains all the Scrabble letters as keys and their point values as values.

1.1

Ask the user for up to seven letters that will represent a Scrabble hand. Calculate the maximum possible score that could be acheived if all the letters in the hand were played.

Scrabble point values

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

Output:

Please enter the letters on your tiles, separated by commas: K,B,D,A,E,V,M

With the letters K, B, D, A, E, V, M the maximum possible score is 19 if all the tiles are played.

1.2

There are only a certain number of tile with each letter in the game of Scrabble. Create another dictionary with the quantities of each letter tile.

As the user is entering their tiles, if the tile their entering would exceed the number available, prevent them from entering that letter and ask for another.

Exercise 2 solution