Cody

# Problem 3100. Rumis Scorer 2

Solution 2153933

Submitted on 8 Mar 2020
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   Fail
clear board board(:,:,1) = ['rrbrbbr';'rbrbbrb';'bbrbbrb';'rbrrrbr';'bbrbbbr';'bbbrrbr']; board(:,:,2) = ['brbbbrb';'rrrbbbr';'bbrbrbr';'brbrbrr';'rbrrrbr';'brbbbbr']; %blue wins 22 to 20 assert(isequal(rumis_scorer2(board),'b'))

s = 23 19 22 20

Output argument "winner" (and maybe others) not assigned during call to "rumis_scorer2". Error in Test1 (line 5) assert(isequal(rumis_scorer2(board),'b'))

2   Fail
clear board board(:,:,1) = ['ppbrpbr';'rbrpbrb';'bbrbbrb';'rbrrppr';'bbrpbbr';'bbprrbr']; board(:,:,2) = ['brbpbrb';'rrpbbpr';'pprbrbr';'brprbrr';'rbrrpbr';'brppbbr']; %red wins 18 to 15 (b) to 9 (p) assert(isequal(rumis_scorer2(board),'r'))

s = 18 8 16 15 9 18

Output argument "winner" (and maybe others) not assigned during call to "rumis_scorer2". Error in Test2 (line 5) assert(isequal(rumis_scorer2(board),'r'))

3   Fail
clear board board(:,:,1) = ['brbrb';'rrrbb';'bggob';'ggoro';'bbrbr']; board(:,:,2) = ['bobrb';'roggr';'bogor';'bgoor';'rgrrr']; board(:,:,3) = ['bobrg';'rrbgr';'rooor';'brbrg';'rgrrr']; board(:,:,4) = ['borbg';'rrbbr';'bbrbr';'bboog';'rgrog']; board(:,:,5) = ['robbr';'bbror';'borbr';'rrobb';'boobg']; %blue wins 10 to 8 (r) to 6 (o) to 1 (g) assert(isequal(rumis_scorer2(board),'b'))

s = 10 4 3 8 5 5 6 9 5 4 4 12 9 4 4 8 10 1 6 8

Output argument "winner" (and maybe others) not assigned during call to "rumis_scorer2". Error in Test3 (line 8) assert(isequal(rumis_scorer2(board),'b'))

4   Fail
clear board board(:,:,1) = ['rrbrryr';'rbrrryb';'brrrbyb';'rbrbyyr';'rbrbryr';'brrrybr']; board(:,:,2) = ['brbybrb';'rbybbbr';'bbrbrbr';'brbryrr';'rbrrbbr';'brbbybr']; board(:,:,3) = ['byyybry';'ybbbyyr';'bbrbyyr';'brbyyrr';'rbyyybr';'brybybr']; %yellow wins 16 to 15 (b) to 11 (r) assert(isequal(rumis_scorer2(board),'y'))

s = 12 23 7 21 17 4 15 11 16

Output argument "winner" (and maybe others) not assigned during call to "rumis_scorer2". Error in Test4 (line 6) assert(isequal(rumis_scorer2(board),'y'))

5   Fail
clear board board(:,:,1) = ['prbrby';'pprbby';'bggoyb';'gpyoro';'bppbyr']; board(:,:,2) = ['pobrby';'rogygr';'bogoyr';'bgyoor';'rgyyyr']; board(:,:,3) = ['ppbrgy';'rpybgr';'roooyr';'brybrg';'rgryrr']; board(:,:,4) = ['borbgy';'rpbybr';'bbrbry';'bbyoog';'rgrpog']; board(:,:,5) = ['robbry';'bprory';'borbry';'rroybb';'booybg']; board(:,:,6) = ['oobyry';'bpryor';'bopbyr';'rooppb';'boobyg']; %orange wins 8 to 7 (b) to 5 (r,y) to 4 (p) to 1 (g) assert(isequal(rumis_scorer2(board),'o'))

s = 8 3 3 6 5 5 4 5 6 1 7 7 4 4 3 3 11 5 9 4 4 2 7 4 9 1 6 1 8 5 7 1 8 4 5 5

Output argument "winner" (and maybe others) not assigned during call to "rumis_scorer2". Error in Test5 (line 9) assert(isequal(rumis_scorer2(board),'o'))

6   Fail
ind = randi(5); switch ind case 1 clear board board(:,:,1) = ['rrbrbbr';'rbrbbrb';'bbrbbrb';'rbrrrbr';'bbrbbbr';'bbbrrbr']; board(:,:,2) = ['brbbbrb';'rrrbbbr';'bbrbrbr';'brbrbrr';'rbrrrbr';'brbbbbr']; assert(isequal(rumis_scorer2(board),'b')) case 2 clear board board(:,:,1) = ['ppbrpbr';'rbrpbrb';'bbrbbrb';'rbrrppr';'bbrpbbr';'bbprrbr']; board(:,:,2) = ['brbpbrb';'rrpbbpr';'pprbrbr';'brprbrr';'rbrrpbr';'brppbbr']; assert(isequal(rumis_scorer2(board),'r')) case 3 clear board board(:,:,1) = ['brbrb';'rrrbb';'bggob';'ggoro';'bbrbr']; board(:,:,2) = ['bobrb';'roggr';'bogor';'bgoor';'rgrrr']; board(:,:,3) = ['bobrg';'rrbgr';'rooor';'brbrg';'rgrrr']; board(:,:,4) = ['borbg';'rrbbr';'bbrbr';'bboog';'rgrog']; board(:,:,5) = ['robbr';'bbror';'borbr';'rrobb';'boobg']; assert(isequal(rumis_scorer2(board),'b')) case 4 clear board board(:,:,1) = ['rrbrryr';'rbrrryb';'brrrbyb';'rbrbyyr';'rbrbryr';'brrrybr']; board(:,:,2) = ['brbybrb';'rbybbbr';'bbrbrbr';'brbryrr';'rbrrbbr';'brbbybr']; board(:,:,3) = ['byyybry';'ybbbyyr';'bbrbyyr';'brbyyrr';'rbyyybr';'brybybr']; assert(isequal(rumis_scorer2(board),'y')) case 5 clear board board(:,:,1) = ['prbrby';'pprbby';'bggoyb';'gpyoro';'bppbyr']; board(:,:,2) = ['pobrby';'rogygr';'bogoyr';'bgyoor';'rgyyyr']; board(:,:,3) = ['ppbrgy';'rpybgr';'roooyr';'brybrg';'rgryrr']; board(:,:,4) = ['borbgy';'rpbybr';'bbrbry';'bbyoog';'rgrpog']; board(:,:,5) = ['robbry';'bprory';'borbry';'rroybb';'booybg']; board(:,:,6) = ['oobyry';'bpryor';'bopbyr';'rooppb';'boobyg']; assert(isequal(rumis_scorer2(board),'o')) end

s = 12 23 7 21 17 4 15 11 16

Output argument "winner" (and maybe others) not assigned during call to "rumis_scorer2". Error in Test6 (line 26) assert(isequal(rumis_scorer2(board),'y'))

7   Fail
ind = randi(5); switch ind case 1 clear board board(:,:,1) = ['rrbrbbr';'rbrbbrb';'bbrbbrb';'rbrrrbr';'bbrbbbr';'bbbrrbr']; board(:,:,2) = ['brbbbrb';'rrrbbbr';'bbrbrbr';'brbrbrr';'rbrrrbr';'brbbbbr']; assert(isequal(rumis_scorer2(board),'b')) case 2 clear board board(:,:,1) = ['ppbrpbr';'rbrpbrb';'bbrbbrb';'rbrrppr';'bbrpbbr';'bbprrbr']; board(:,:,2) = ['brbpbrb';'rrpbbpr';'pprbrbr';'brprbrr';'rbrrpbr';'brppbbr']; assert(isequal(rumis_scorer2(board),'r')) case 3 clear board board(:,:,1) = ['brbrb';'rrrbb';'bggob';'ggoro';'bbrbr']; board(:,:,2) = ['bobrb';'roggr';'bogor';'bgoor';'rgrrr']; board(:,:,3) = ['bobrg';'rrbgr';'rooor';'brbrg';'rgrrr']; board(:,:,4) = ['borbg';'rrbbr';'bbrbr';'bboog';'rgrog']; board(:,:,5) = ['robbr';'bbror';'borbr';'rrobb';'boobg']; assert(isequal(rumis_scorer2(board),'b')) case 4 clear board board(:,:,1) = ['rrbrryr';'rbrrryb';'brrrbyb';'rbrbyyr';'rbrbryr';'brrrybr']; board(:,:,2) = ['brbybrb';'rbybbbr';'bbrbrbr';'brbryrr';'rbrrbbr';'brbbybr']; board(:,:,3) = ['byyybry';'ybbbyyr';'bbrbyyr';'brbyyrr';'rbyyybr';'brybybr']; assert(isequal(rumis_scorer2(board),'y')) case 5 clear board board(:,:,1) = ['prbrby';'pprbby';'bggoyb';'gpyoro';'bppbyr']; board(:,:,2) = ['pobrby';'rogygr';'bogoyr';'bgyoor';'rgyyyr']; board(:,:,3) = ['ppbrgy';'rpybgr';'roooyr';'brybrg';'rgryrr']; board(:,:,4) = ['borbgy';'rpbybr';'bbrbry';'bbyoog';'rgrpog']; board(:,:,5) = ['robbry';'bprory';'borbry';'rroybb';'booybg']; board(:,:,6) = ['oobyry';'bpryor';'bopbyr';'rooppb';'boobyg']; assert(isequal(rumis_scorer2(board),'o')) end

s = 23 19 22 20

Output argument "winner" (and maybe others) not assigned during call to "rumis_scorer2". Error in Test7 (line 7) assert(isequal(rumis_scorer2(board),'b'))

8   Fail
ind = randi(5); switch ind case 1 clear board board(:,:,1) = ['rrbrbbr';'rbrbbrb';'bbrbbrb';'rbrrrbr';'bbrbbbr';'bbbrrbr']; board(:,:,2) = ['brbbbrb';'rrrbbbr';'bbrbrbr';'brbrbrr';'rbrrrbr';'brbbbbr']; assert(isequal(rumis_scorer2(board),'b')) case 2 clear board board(:,:,1) = ['ppbrpbr';'rbrpbrb';'bbrbbrb';'rbrrppr';'bbrpbbr';'bbprrbr']; board(:,:,2) = ['brbpbrb';'rrpbbpr';'pprbrbr';'brprbrr';'rbrrpbr';'brppbbr']; assert(isequal(rumis_scorer2(board),'r')) case 3 clear board board(:,:,1) = ['brbrb';'rrrbb';'bggob';'ggoro';'bbrbr']; board(:,:,2) = ['bobrb';'roggr';'bogor';'bgoor';'rgrrr']; board(:,:,3) = ['bobrg';'rrbgr';'rooor';'brbrg';'rgrrr']; board(:,:,4) = ['borbg';'rrbbr';'bbrbr';'bboog';'rgrog']; board(:,:,5) = ['robbr';'bbror';'borbr';'rrobb';'boobg']; assert(isequal(rumis_scorer2(board),'b')) case 4 clear board board(:,:,1) = ['rrbrryr';'rbrrryb';'brrrbyb';'rbrbyyr';'rbrbryr';'brrrybr']; board(:,:,2) = ['brbybrb';'rbybbbr';'bbrbrbr';'brbryrr';'rbrrbbr';'brbbybr']; board(:,:,3) = ['byyybry';'ybbbyyr';'bbrbyyr';'brbyyrr';'rbyyybr';'brybybr']; assert(isequal(rumis_scorer2(board),'y')) case 5 clear board board(:,:,1) = ['prbrby';'pprbby';'bggoyb';'gpyoro';'bppbyr']; board(:,:,2) = ['pobrby';'rogygr';'bogoyr';'bgyoor';'rgyyyr']; board(:,:,3) = ['ppbrgy';'rpybgr';'roooyr';'brybrg';'rgryrr']; board(:,:,4) = ['borbgy';'rpbybr';'bbrbry';'bbyoog';'rgrpog']; board(:,:,5) = ['robbry';'bprory';'borbry';'rroybb';'booybg']; board(:,:,6) = ['oobyry';'bpryor';'bopbyr';'rooppb';'boobyg']; assert(isequal(rumis_scorer2(board),'o')) end

s = 12 23 7 21 17 4 15 11 16

Output argument "winner" (and maybe others) not assigned during call to "rumis_scorer2". Error in Test8 (line 26) assert(isequal(rumis_scorer2(board),'y'))

### Community Treasure Hunt

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

Start Hunting!