Cody

# Problem 3102. Rumis Scorer 4

Solution 3466578

Submitted on 29 Oct 2020 at 9:19 by pign_an
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
clear board stencil stencil = [ 1 1 1 1 1 1 1 1; 2 2 2 2 2 2 2 2; 0 3 3 3 3 3 3 0; 0 4 4 4 4 4 4 0; 0 0 5 5 5 5 0 0; 0 0 6 6 6 6 0 0; 0 0 0 7 7 0 0 0; 0 0 0 8 8 0 0 0; ]; board(:,:,1) = ['bbbbyyyy';'bbrryyyg';' bbrryy ';' bbryyg ';' bbgg ';' bbbg ';' yy ';' yb ']; board(:,:,2) = [' ';'bbrryyyg';' brryyg ';' brrygg ';' bbrg ';' bbg ';' by ';' yy ']; board(:,:,3) = [' ';' ';' brry g ';' bbrygg ';' brrg ';' brg ';' br ';' bb ']; board(:,:,4) = [' ';' ';' b ';' bb ygg ';' bryg ';' rrg ';' rr ';' br ']; board(:,:,5) = [' ';' ';' ';' ';' ggg ';' ggy ';' gg ';' rr ']; board(:,:,6) = [' ';' ';' ';' ';' ';' gyy ';' gr ';' gr ']; board(:,:,7) = [' ';' ';' ';' ';' ';' ';' gg ';' gr ']; board(:,:,8) = [' ';' ';' ';' ';' ';' ';' ';' r ']; %yellow wins 12 to 11 (g,b) to 6 (r) assert(isequal(rumis_scorer4(board,stencil),'y'))

low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 1 low = 0 low = 0 low = 0 low = 0 low = 1 low = 0 low = 0 low = 0 low = 0 low = 1 low = 0 low = 0 low = 0 low = 0 low = 1 low = 2 low = 3 low = 4 low = 5 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 1 low = 0

2   Pass
clear board stencil stencil = [ 2 2 2 2 2 2; 3 3 3 3 3 3; 4 4 4 4 4 4; 5 5 5 5 5 5; 5 5 5 5 5 5; 5 5 5 5 5 5; 5 5 5 5 5 5; 4 4 4 4 4 4; 3 3 3 3 3 3; 2 2 2 2 2 2; ]; board(:,:,1) = ['rrrrbb';'ggrbbb';'ggrrpb';'ggrpbb';'grrppb';'oorrpb';'ooppbb';'ooybbp';'ooyypp';'yyyypp']; board(:,:,2) = ['grrr b';'ggrbpb';'ggrrpb';'rrrbpb';'grbbpp';'ooobpb';'ooyyyb';'oooyyb';'oooypp';'yyyypp']; board(:,:,3) = [' ';'ggrbbb';'ggrrpb';'rrrbbb';'grpbbp';'grppbb';'gyyypb';'ogoypb';'ooo pp';' ']; board(:,:,4) = [' ';' ';'ggrrpb';'rrrbpb';'grpbpp';' rbbbb';' yyybb';'ogoypp';' ';' ']; board(:,:,5) = [' ';' ';' ';'rrrbbb';' rpppp';' r bb';' y y b';' ';' ';' ']; %blue wins 15 to 11 (r,p) to 9 (y,g) to 5 (o) assert(isequal(rumis_scorer4(board,stencil),'b'))

low = 0 low = 0 low = 0 low = 0 low = 0 low = 1 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 1 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 1 low = 2 low = 0 low = 0 low = 1 low = 0 low = 1 low = 0 low = 0 low = 0 low = 1 low = 2 low = 0 low = 0 low = 1 low = 0 low = 0 low = 1 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 1 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0

3   Pass
clear board stencil stencil = [ 1 2 3 4 4 4 4 4; 1 2 3 4 4 4 4 4; 1 2 3 4 4 4 4 4; 1 2 3 4 4 4 4 4; 0 0 0 0 3 3 3 3; 0 0 0 0 2 2 2 2; 0 0 0 0 1 1 1 1; ]; board(:,:,1) = ['rrbrrbbr';'rbrrbbrb';'bbrrbbrb';'rbrrbrbr';' brbr';' rrbr';' bbbr']; board(:,:,2) = [' brbbrb';' rrbbbbr';' brbbrbr';' brbbrbr';' rbrb';' brb ';' ']; board(:,:,3) = [' brbbrr';' bbbbr';' rbbrbr';' brrrr';' bb r';' ';' ']; board(:,:,4) = [' rbbr ';' rbbbr';' brrbr';' rbrr ';' ';' ';' ']; %red wins 25 to 19 assert(isequal(rumis_scorer4(board,stencil),'r'))

low = 0 low = 0 low = 1 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 1 low = 0 low = 0 low = 0 low = 1 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 1 low = 0 low = 0 low = 0 low = 0 low = 0 low = 1 low = 0 low = 0 low = 0 low = 1 low = 0 low = 0 low = 0 low = 0 low = 0 low = 1 low = 0 low = 0 low = 0 low = 0

4   Pass
clear board stencil stencil = [ 1 1 1 1 1 1 1 1; 1 2 2 2 2 2 2 1; 1 2 3 3 3 3 2 1; 1 2 3 4 4 3 2 1; 1 2 3 4 4 3 2 1; 1 2 3 3 3 3 2 1; 1 2 2 2 2 2 2 1; 1 1 1 1 1 1 1 1; ]; board(:,:,1) = ['yyyyybrr';'yyrrbbyr';'yryyyrrr';'yryyrrrr';'yyyrrrbb';'yrrrrbbb';'yyrrrgbb';'yyrrgggb']; board(:,:,2) = [' ';' r yb b ';' yyybb ';' rygrr ';' ryyggr ';' ggygrr ';' ggyggb ';' ']; board(:,:,3) = [' ';' ';' ggy ';' gb r ';' ggbr ';' ggrr ';' ';' ']; board(:,:,4) = [' ';' ';' ';' b ';' b ';' ';' ';' ']; %red wins 19 to 16 (y) to 15 (g) to 14 (b) assert(isequal(rumis_scorer4(board,stencil),'r'))

low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 1 low = 0 low = 0 low = 0 low = 1 low = 0 low = 0 low = 0 low = 0 low = 1 low = 0 low = 0 low = 0 low = 0 low = 1 low = 0 low = 0 low = 0 low = 0 low = 1 low = 0 low = 0 low = 0 low = 1 low = 2 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 1 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0

5   Pass
clear board stencil stencil = [ 0 0 0 0 1 0 0 0 0; 0 0 0 1 2 1 0 0 0; 0 0 1 2 3 2 1 0 0; 0 1 2 3 4 3 2 1 0; 1 2 3 4 5 4 3 2 1; 0 1 2 3 4 3 2 1 0; 0 0 1 2 3 2 1 0 0; 0 0 0 1 2 1 0 0 0; 0 0 0 0 1 0 0 0 0; ]; board(:,:,1) = [' o ';' oob ';' oobbp ';' obbbppp ';'obboopppo';' oobbbpp ';' ooooo ';' opo ';' o ']; board(:,:,2) = [' ';' o ';' bbb ';' bbp ';' obbppp ';' obbbp ';' bbb ';' ';' ']; board(:,:,3) = [' ';' ';' b ';' bb ';' o bbp ';' b ';' ';' ';' ']; board(:,:,4) = [' ';' ';' ';' b ';' o ';' ';' ';' ';' ']; board(:,:,5) = [' ';' ';' ';' ';' o ';' ';' ';' ';' ']; %blue wins 17 to 16 (o) to 8 (p) assert(isequal(rumis_scorer4(board,stencil),'b'))

low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 1 low = 0 low = 1 low = 2 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 1 low = 0 low = 0 low = 1 low = 2 low = 0 low = 0 low = 1 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 1 low = 0 low = 1 low = 2 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 1 low = 0 low = 0 low = 0 low = 0 low = 1 low = 0 low = 0

6   Pass
clear board stencil stencil = [ 2 2 3 3 3 3 2 2; 2 2 4 4 4 4 2 2; 3 4 5 6 6 5 4 3; 3 4 6 7 7 6 4 3; 3 4 6 7 7 6 4 3; 3 4 5 6 6 5 4 3; 2 2 4 4 4 4 2 2; 2 2 3 3 3 3 2 2; ]; board(:,:,1) = ['rryyobpg';'ryyyobpg';'ryyoobbg';'rryoobbg';'ryyybbgg';'yyybbggg';'ybbbbggg';'yyyyyggg']; board(:,:,2) = ['ryyooopp';'rrryyppp';'rryooogg';'rrrroobb';'ryyybggg';'rybbbbbg';'bgyyyggg';'byygyygg']; board(:,:,3) = [' yyoo ';' ryyp ';'rrroobgg';'rrryobbb';'ryyyoppp';'rrrorybg';' gyybo ';' oyb ']; board(:,:,4) = [' ';' yybp ';' robop ';' gbboo ';' boybo ';' rbggpp ';' ybbo ';' ']; board(:,:,5) = [' ';' ';' boo ';' ggbb ';' oyyy ';' ppp ';' ';' ']; board(:,:,6) = [' ';' ';' oo ';' g bb ';' ooyy ';' p ';' ';' ']; board(:,:,7) = [' ';' ';' ';' o ';' oy ';' ';' ';' ']; %orange wins 12 to 11 (y,p) to 10 (r,g,b) assert(isequal(rumis_scorer4(board,stencil),'o'))

low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 1 low = 0 low = 0 low = 0 low = 0 low = 1 low = 0 low = 0 low = 0 low = 1 low = 0 low = 0 low = 1 low = 2 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 1 low = 0 low = 0 low = 0 low = 0 low = 1 low = 0 low = 1 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 1 low = 0 low = 0

7   Pass
ind = randi(6); switch ind case 1 clear board stencil stencil = [ 1 1 1 1 1 1 1 1; 2 2 2 2 2 2 2 2; 0 3 3 3 3 3 3 0; 0 4 4 4 4 4 4 0; 0 0 5 5 5 5 0 0; 0 0 6 6 6 6 0 0; 0 0 0 7 7 0 0 0; 0 0 0 8 8 0 0 0; ]; board(:,:,1) = ['bbbbyyyy';'bbrryyyg';' bbrryy ';' bbryyg ';' bbgg ';' bbbg ';' yy ';' yb ']; board(:,:,2) = [' ';'bbrryyyg';' brryyg ';' brrygg ';' bbrg ';' bbg ';' by ';' yy ']; board(:,:,3) = [' ';' ';' brry g ';' bbrygg ';' brrg ';' brg ';' br ';' bb ']; board(:,:,4) = [' ';' ';' b ';' bb ygg ';' bryg ';' rrg ';' rr ';' br ']; board(:,:,5) = [' ';' ';' ';' ';' ggg ';' ggy ';' gg ';' rr ']; board(:,:,6) = [' ';' ';' ';' ';' ';' gyy ';' gr ';' gr ']; board(:,:,7) = [' ';' ';' ';' ';' ';' ';' gg ';' gr ']; board(:,:,8) = [' ';' ';' ';' ';' ';' ';' ';' r ']; assert(isequal(rumis_scorer4(board,stencil),'y')) case 2 clear board stencil stencil = [ 2 2 2 2 2 2; 3 3 3 3 3 3; 4 4 4 4 4 4; 5 5 5 5 5 5; 5 5 5 5 5 5; 5 5 5 5 5 5; 5 5 5 5 5 5; 4 4 4 4 4 4; 3 3 3 3 3 3; 2 2 2 2 2 2; ]; board(:,:,1) = ['rrrrbb';'ggrbbb';'ggrrpb';'ggrpbb';'grrppb';'oorrpb';'ooppbb';'ooybbp';'ooyypp';'yyyypp']; board(:,:,2) = ['grrr b';'ggrbpb';'ggrrpb';'rrrbpb';'grbbpp';'ooobpb';'ooyyyb';'oooyyb';'oooypp';'yyyypp']; board(:,:,3) = [' ';'ggrbbb';'ggrrpb';'rrrbbb';'grpbbp';'grppbb';'gyyypb';'ogoypb';'ooo pp';' ']; board(:,:,4) = [' ';' ';'ggrrpb';'rrrbpb';'grpbpp';' rbbbb';' yyybb';'ogoypp';' ';' ']; board(:,:,5) = [' ';' ';' ';'rrrbbb';' rpppp';' r bb';' y y b';' ';' ';' ']; assert(isequal(rumis_scorer4(board,stencil),'b')) case 3 clear board stencil stencil = [ 1 2 3 4 4 4 4 4; 1 2 3 4 4 4 4 4; 1 2 3 4 4 4 4 4; 1 2 3 4 4 4 4 4; 0 0 0 0 3 3 3 3; 0 0 0 0 2 2 2 2; 0 0 0 0 1 1 1 1; ]; board(:,:,1) = ['rrbrrbbr';'rbrrbbrb';'bbrrbbrb';'rbrrbrbr';' brbr';' rrbr';' bbbr']; board(:,:,2) = [' brbbrb';' rrbbbbr';' brbbrbr';' brbbrbr';' rbrb';' brb ';' ']; board(:,:,3) = [' brbbrr';' bbbbr';' rbbrbr';' brrrr';' bb r';' ';' ']; board(:,:,4) = [' rbbr ';' rbbbr';' brrbr';' rbrr ';' ';' ';' ']; assert(isequal(rumis_scorer4(board,stencil),'r')) case 4 clear board stencil stencil = [ 1 1 1 1 1 1 1 1; 1 2 2 2 2 2 2 1; 1 2 3 3 3 3 2 1; 1 2 3 4 4 3 2 1; 1 2 3 4 4 3 2 1; 1 2 3 3 3 3 2 1; 1 2 2 2 2 2 2 1; 1 1 1 1 1 1 1 1; ]; board(:,:,1) = ['yyyyybrr';'yyrrbbyr';'yryyyrrr';'yryyrrrr';'yyyrrrbb';'yrrrrbbb';'yyrrrgbb';'yyrrgggb']; board(:,:,2) = [' ';' r yb b ';' yyybb ';' rygrr ';' ryyggr ';' ggygrr ';' ggyggb ';' ']; board(:,:,3) = [' ';' ';' ggy ';' gb r ';' ggbr ';' ggrr ';' ';' ']; board(:,:,4) = [' ';' ';' ';' b ';' b ';' ';' ';' ']; assert(isequal(rumis_scorer4(board,stencil),'r')) case 5 clear board stencil stencil = [ 0 0 0 0 1 0 0 0 0; 0 0 0 1 2 1 0 0 0; 0 0 1 2 3 2 1 0 0; 0 1 2 3 4 3 2 1 0; 1 2 3 4 5 4 3 2 1; 0 1 2 3 4 3 2 1 0; 0 0 1 2 3 2 1 0 0; 0 0 0 1 2 1 0 0 0; 0 0 0 0 1 0 0 0 0; ]; board(:,:,1) = [' o ';' oob ';' oobbp ';' obbbppp ';'obboopppo';' oobbbpp ';' ooooo ';' opo ';' o ']; board(:,:,2) = [' ';' o ';' bbb ';' bbp ';' obbppp ';' obbbp ';' bbb ';' ';' ']; board(:,:,3) = [' ';' ';' b ';' bb ';' o bbp ';' b ';' ';' ';' ']; board(:,:,4) = [' ';' ';' ';' b ';' o ';' ';' ';' ';' ']; board(:,:,5) = [' ';' ';' ';' ';' o ';' ';' ';' ';' ']; assert(isequal(rumis_scorer4(board,stencil),'b')) case 6 clear board stencil stencil = [ 2 2 3 3 3 3 2 2; 2 2 4 4 4 4 2 2; 3 4 5 6 6 5 4 3; 3 4 6 7 7 6 4 3; 3 4 6 7 7 6 4 3; 3 4 5 6 6 5 4 3; 2 2 4 4 4 4 2 2; 2 2 3 3 3 3 2 2; ]; board(:,:,1) = ['rryyobpg';'ryyyobpg';'ryyoobbg';'rryoobbg';'ryyybbgg';'yyybbggg';'ybbbbggg';'yyyyyggg']; board(:,:,2) = ['ryyooopp';'rrryyppp';'rryooogg';'rrrroobb';'ryyybggg';'rybbbbbg';'bgyyyggg';'byygyygg']; board(:,:,3) = [' yyoo ';' ryyp ';'rrroobgg';'rrryobbb';'ryyyoppp';'rrrorybg';' gyybo ';' oyb ']; board(:,:,4) = [' ';' yybp ';' robop ';' gbboo ';' boybo ';' rbggpp ';' ybbo ';' ']; board(:,:,5) = [' ';' ';' boo ';' ggbb ';' oyyy ';' ppp ';' ';' ']; board(:,:,6) = [' ';' ';' oo ';' g bb ';' ooyy ';' p ';' ';' ']; board(:,:,7) = [' ';' ';' ';' o ';' oy ';' ';' ';' ']; assert(isequal(rumis_scorer4(board,stencil),'o')) end

low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 1 low = 0 low = 0 low = 0 low = 0 low = 1 low = 0 low = 0 low = 0 low = 1 low = 0 low = 0 low = 1 low = 2 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 1 low = 0 low = 0 low = 0 low = 0 low = 1 low = 0 low = 1 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 1 low = 0 low = 0

8   Pass
ind = randi(6); switch ind case 1 clear board stencil stencil = [ 1 1 1 1 1 1 1 1; 2 2 2 2 2 2 2 2; 0 3 3 3 3 3 3 0; 0 4 4 4 4 4 4 0; 0 0 5 5 5 5 0 0; 0 0 6 6 6 6 0 0; 0 0 0 7 7 0 0 0; 0 0 0 8 8 0 0 0; ]; board(:,:,1) = ['bbbbyyyy';'bbrryyyg';' bbrryy ';' bbryyg ';' bbgg ';' bbbg ';' yy ';' yb ']; board(:,:,2) = [' ';'bbrryyyg';' brryyg ';' brrygg ';' bbrg ';' bbg ';' by ';' yy ']; board(:,:,3) = [' ';' ';' brry g ';' bbrygg ';' brrg ';' brg ';' br ';' bb ']; board(:,:,4) = [' ';' ';' b ';' bb ygg ';' bryg ';' rrg ';' rr ';' br ']; board(:,:,5) = [' ';' ';' ';' ';' ggg ';' ggy ';' gg ';' rr ']; board(:,:,6) = [' ';' ';' ';' ';' ';' gyy ';' gr ';' gr ']; board(:,:,7) = [' ';' ';' ';' ';' ';' ';' gg ';' gr ']; board(:,:,8) = [' ';' ';' ';' ';' ';' ';' ';' r ']; assert(isequal(rumis_scorer4(board,stencil),'y')) case 2 clear board stencil stencil = [ 2 2 2 2 2 2; 3 3 3 3 3 3; 4 4 4 4 4 4; 5 5 5 5 5 5; 5 5 5 5 5 5; 5 5 5 5 5 5; 5 5 5 5 5 5; 4 4 4 4 4 4; 3 3 3 3 3 3; 2 2 2 2 2 2; ]; board(:,:,1) = ['rrrrbb';'ggrbbb';'ggrrpb';'ggrpbb';'grrppb';'oorrpb';'ooppbb';'ooybbp';'ooyypp';'yyyypp']; board(:,:,2) = ['grrr b';'ggrbpb';'ggrrpb';'rrrbpb';'grbbpp';'ooobpb';'ooyyyb';'oooyyb';'oooypp';'yyyypp']; board(:,:,3) = [' ';'ggrbbb';'ggrrpb';'rrrbbb';'grpbbp';'grppbb';'gyyypb';'ogoypb';'ooo pp';' ']; board(:,:,4) = [' ';' ';'ggrrpb';'rrrbpb';'grpbpp';' rbbbb';' yyybb';'ogoypp';' ';' ']; board(:,:,5) = [' ';' ';' ';'rrrbbb';' rpppp';' r bb';' y y b';' ';' ';' ']; assert(isequal(rumis_scorer4(board,stencil),'b')) case 3 clear board stencil stencil = [ 1 2 3 4 4 4 4 4; 1 2 3 4 4 4 4 4; 1 2 3 4 4 4 4 4; 1 2 3 4 4 4 4 4; 0 0 0 0 3 3 3 3; 0 0 0 0 2 2 2 2; 0 0 0 0 1 1 1 1; ]; board(:,:,1) = ['rrbrrbbr';'rbrrbbrb';'bbrrbbrb';'rbrrbrbr';' brbr';' rrbr';' bbbr']; board(:,:,2) = [' brbbrb';' rrbbbbr';' brbbrbr';' brbbrbr';' rbrb';' brb ';' ']; board(:,:,3) = [' brbbrr';' bbbbr';' rbbrbr';' brrrr';' bb r';' ';' ']; board(:,:,4) = [' rbbr ';' rbbbr';' brrbr';' rbrr ';' ';' ';' ']; assert(isequal(rumis_scorer4(board,stencil),'r')) case 4 clear board stencil stencil = [ 1 1 1 1 1 1 1 1; 1 2 2 2 2 2 2 1; 1 2 3 3 3 3 2 1; 1 2 3 4 4 3 2 1; 1 2 3 4 4 3 2 1; 1 2 3 3 3 3 2 1; 1 2 2 2 2 2 2 1; 1 1 1 1 1 1 1 1; ]; board(:,:,1) = ['yyyyybrr';'yyrrbbyr';'yryyyrrr';'yryyrrrr';'yyyrrrbb';'yrrrrbbb';'yyrrrgbb';'yyrrgggb']; board(:,:,2) = [' ';' r yb b ';' yyybb ';' rygrr ';' ryyggr ';' ggygrr ';' ggyggb ';' ']; board(:,:,3) = [' ';' ';' ggy ';' gb r ';' ggbr ';' ggrr ';' ';' ']; board(:,:,4) = [' ';' ';' ';' b ';' b ';' ';' ';' ']; assert(isequal(rumis_scorer4(board,stencil),'r')) case 5 clear board stencil stencil = [ 0 0 0 0 1 0 0 0 0; 0 0 0 1 2 1 0 0 0; 0 0 1 2 3 2 1 0 0; 0 1 2 3 4 3 2 1 0; 1 2 3 4 5 4 3 2 1; 0 1 2 3 4 3 2 1 0; 0 0 1 2 3 2 1 0 0; 0 0 0 1 2 1 0 0 0; 0 0 0 0 1 0 0 0 0; ]; board(:,:,1) = [' o ';' oob ';' oobbp ';' obbbppp ';'obboopppo';' oobbbpp ';' ooooo ';' opo ';' o ']; board(:,:,2) = [' ';' o ';' bbb ';' bbp ';' obbppp ';' obbbp ';' bbb ';' ';' ']; board(:,:,3) = [' ';' ';' b ';' bb ';' o bbp ';' b ';' ';' ';' ']; board(:,:,4) = [' ';' ';' ';' b ';' o ';' ';' ';' ';' ']; board(:,:,5) = [' ';' ';' ';' ';' o ';' ';' ';' ';' ']; assert(isequal(rumis_scorer4(board,stencil),'b')) case 6 clear board stencil stencil = [ 2 2 3 3 3 3 2 2; 2 2 4 4 4 4 2 2; 3 4 5 6 6 5 4 3; 3 4 6 7 7 6 4 3; 3 4 6 7 7 6 4 3; 3 4 5 6 6 5 4 3; 2 2 4 4 4 4 2 2; 2 2 3 3 3 3 2 2; ]; board(:,:,1) = ['rryyobpg';'ryyyobpg';'ryyoobbg';'rryoobbg';'ryyybbgg';'yyybbggg';'ybbbbggg';'yyyyyggg']; board(:,:,2) = ['ryyooopp';'rrryyppp';'rryooogg';'rrrroobb';'ryyybggg';'rybbbbbg';'bgyyyggg';'byygyygg']; board(:,:,3) = [' yyoo ';' ryyp ';'rrroobgg';'rrryobbb';'ryyyoppp';'rrrorybg';' gyybo ';' oyb ']; board(:,:,4) = [' ';' yybp ';' robop ';' gbboo ';' boybo ';' rbggpp ';' ybbo ';' ']; board(:,:,5) = [' ';' ';' boo ';' ggbb ';' oyyy ';' ppp ';' ';' ']; board(:,:,6) = [' ';' ';' oo ';' g bb ';' ooyy ';' p ';' ';' ']; board(:,:,7) = [' ';' ';' ';' o ';' oy ';' ';' ';' ']; assert(isequal(rumis_scorer4(board,stencil),'o')) end

low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 1 low = 0 low = 0 low = 0 low = 0 low = 1 low = 0 low = 0 low = 0 low = 1 low = 0 low = 0 low = 1 low = 2 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 1 low = 0 low = 0 low = 0 low = 0 low = 1 low = 0 low = 1 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 0 low = 1 low = 0 low = 0

### Community Treasure Hunt

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

Start Hunting!