Problem 3081. Scrabble Scores - 4
This problem is part of a set of problems that successively develop a more sophisticated Scrabble scoring routine. The point distribution for scoring is provided here. (Use the English points distribution.)
For this problem, you will be provided with a set of words and the accompanying bonus squares that each word covered. The words will be provided in a cell array of strings. Write a function to calculate the total score for the set of words using the multipliers. The multipliers are as follows:
* D: double word * T: triple word * Q: quadruple word * d: double letter * t: triple letter * q: quadruple letter
For those not familiar with quadruple word (Q) and quadruple letter (q), those were introduced in Super Scrabble. Also, remember that the d, t, and q multipliers take effect before the D, T, and Q multipliers. Also, multiple word multipliers can be present, having a cumulative effect (e.g., D & T = *6).
As an example, if the word were 'matlab' and the multiplier string array was
[' ','D',' ',' ',' ','d'] (or ' D d')
then the score would be (3 + 1 + 1 + 1 + 1 + 2*3)*2 = 26. Each word in the set should be scored in this manner and the total score summed.
Related problems:
Previous problem: 3 - Single-word multiplier scoring. Next problem: 5 - Multiplayer word-set scoring.
Solution Stats
Problem Comments
-
4 Comments
This is a revised version of problem #4 in the Scrabble Scores series. The multipliers are in strings arrays, rather than double-level cell arrays, to coincide with the subsequent problems.
Test suit is broken as it keeps only the first case string array to the entire suit . Please fix since its a Word Puzzles problem
@Nikolaos Nikolaou: can you be more specific? I just re-tested two previous solutions and they worked fine. Each of the test cases contains single-line variables.
I've just solved the problem. It seems to be working fine.
Solution Comments
Show commentsProblem Recent Solvers30
Suggested Problems
-
860 Solvers
-
214 Solvers
-
Getting the indices from a matrix
648 Solvers
-
1031 Solvers
-
147 Solvers
More from this Author139
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!