Cody

Solution 590207

Submitted on 2 Mar 2015 by James
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
%% board = [ ' cat '; ' i p '; ' t poet'; ' c l '; 'there '; ]; score = 28; assert(isequal(scrabble_scores_6(board),score))

ans = 28

2   Pass
%% board = [ 'stratagems'; ' h a '; 'hello t '; ' r l '; 'fellow a '; ' a b '; ' users '; ]; score = 51; assert(isequal(scrabble_scores_6(board),score))

ans = 51

3   Pass
%% board = [ ' what y '; ' h do '; ' this um'; ' l n a'; ' of keen t'; ' o e l'; ' problem a'; ' noob'; ]; score = 72; assert(isequal(scrabble_scores_6(board),score))

ans = 72

4   Pass
%% board = [ ' if you '; ' i u '; ' like '; ' met g '; ' e it l'; ' e v i'; ' please k'; ' node'; ]; score = 56; assert(isequal(scrabble_scores_6(board),score))

ans = 56

5   Pass
%% board = [ 'c flummoxes zither'; 'al o e e e'; 'ba hunting eerie b'; 'ab a g e o e'; 'lo n m g l'; ' r g responses '; 'random n u u '; ' t v c below p r '; 'convention r e f '; ' r r n a areas'; ' y v c t i c '; ' o philosophy o em'; 'travel n n r r e'; ' e c t e'; ' word i a writer'; ' t n c o l'; 'p fortnight rock y'; 'i n h '; 'novelty m concatenate'; 'c e o a a s g'; 'heterogeneousness g'; ]; score = 364; assert(isequal(scrabble_scores_6(board),score))

ans = 364

6   Pass
%% anti-cheating test case ind = randi(4); switch ind case 1 board = [ ' cat '; ' i p '; ' t poet'; ' c l '; 'there ']; score = 28; case 2 board = [ 'stratagems'; ' h a '; 'hello t '; ' r l '; 'fellow a '; ' a b '; ' users ']; score = 51; case 3 board = [ ' what y '; ' e h do '; ' this um'; ' of n a'; ' keen t'; ' e l'; ' problem a'; ' noob']; score = 71; case 4 board = [ ' if you '; ' i u '; ' like '; ' met g '; ' it l'; ' v i'; ' please k'; ' node']; score = 54; end assert(isequal(scrabble_scores_6(board),score))

ans = 71

7   Pass
%% anti-cheating test case (again) ind = randi(4); switch ind case 1 board = [ ' cat '; ' i p '; ' t poet'; ' c l '; 'there ']; score = 28; case 2 board = [ 'stratagems'; ' h a '; 'hello t '; ' r l '; 'fellow a '; ' a b '; ' users ']; score = 51; case 3 board = [ ' what y '; ' e h do '; ' this um'; ' of n a'; ' keen t'; ' e l'; ' problem a'; ' noob']; score = 71; case 4 board = [ ' if you '; ' i u '; ' like '; ' met g '; ' it l'; ' v i'; ' please k'; ' node']; score = 54; end assert(isequal(scrabble_scores_6(board),score))

ans = 54

8   Pass
%% anti-cheating test case (and a third time, to lower the chance of getting lucky) ind = randi(4); switch ind case 1 board = [ ' cat '; ' i p '; ' t poet'; ' c l '; 'there ']; score = 28; case 2 board = [ 'stratagems'; ' h a '; 'hello t '; ' r l '; 'fellow a '; ' a b '; ' users ']; score = 51; case 3 board = [ ' what y '; ' e h do '; ' this um'; ' of n a'; ' keen t'; ' e l'; ' problem a'; ' noob']; score = 71; case 4 board = [ ' if you '; ' i u '; ' like '; ' met g '; ' it l'; ' v i'; ' please k'; ' node']; score = 54; end assert(isequal(scrabble_scores_6(board),score))

ans = 71