Cody

Problem 56. Scrabble Scores

Solution 3189336

Submitted on 13 Oct 2020 by JB
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
str = 'a'; score = 1; assert(isequal(scrabble_score(str),score))

score = 1 gets in to one 117 105 106 116 33 106 116 33 106 117 64 33

2   Pass
str = 'matlab'; score = 10; assert(isequal(scrabble_score(str),score))

score = 3 score = 4 gets in to one score = 5 gets in to one score = 6 gets in to one score = 7 gets in to one score = 10 126 114 115 125 42 115 125 42 115 126 73 42

3   Pass
str = 'quetzalcoatl'; score = 32; assert(isequal(scrabble_score(str),score))

score = 10 score = 11 gets in to one score = 12 gets in to one score = 13 gets in to one score = 23 score = 24 gets in to one score = 25 gets in to one score = 28 score = 29 gets in to one score = 30 gets in to one score = 31 gets in to one score = 32 gets in to one 148 136 137 147 64 137 147 64 137 148 95 64

4   Pass
str = 'quartz'; score = 24; assert(isequal(scrabble_score(str),score))

score = 10 score = 11 gets in to one score = 12 gets in to one score = 13 gets in to one score = 14 gets in to one score = 24 140 128 129 139 56 129 139 56 129 140 87 56

5   Pass
str = 'jackal'; score = 19; assert(isequal(scrabble_score(str),score))

score = 8 score = 9 gets in to one score = 12 score = 17 score = 18 gets in to one score = 19 gets in to one 135 123 124 134 51 124 134 51 124 135 82 51

Suggested Problems

More from this Author95

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!