Cody

# Problem 3099. Rumis Scorer 1

Solution 2153873

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_scorer1(board),'b'))

ans = 42×1 char array 'b' 'r' 'b' 'b' 'r' 'b' 'r' 'r' 'b' 'r' 'b' 'r' 'b' 'r' 'r' 'b' 'r' 'b' 'b' 'b' 'b' 'r' 'r' 'b' 'b' 'b' 'r' 'b' 'r' 'b' 'r' 'b' 'b' 'r' 'b' 'b' 'b' 'r' 'r' 'r' 'r' 'r'

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

2   Fail
clear board board(:,:,1) = ['brbrb';'rrrbb';'bbrbb';'bbrrb';'bbrbr']; board(:,:,2) = ['brbrb';'rrbbr';'bbrbr';'brbrr';'rbrrr']; %red wins 14 to 11 assert(isequal(rumis_scorer1(board),'r'))

ans = 25×1 char array 'b' 'r' 'b' 'b' 'r' 'r' 'r' 'b' 'r' 'b' 'b' 'b' 'r' 'b' 'r' 'r' 'b' 'b' 'r' 'r' 'b' 'r' 'r' 'r' 'r'

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

3   Fail
clear board board(:,:,1) = ['brb';'rrr';'bbb';'brb';'bbr']; board(:,:,2) = ['brb';'rbr';'rbr';'brr';'rrr']; %red wins 10 to 5 assert(isequal(rumis_scorer1(board),'r'))

ans = 15×1 char array 'b' 'r' 'r' 'b' 'r' 'r' 'b' 'b' 'r' 'r' 'b' 'r' 'r' 'r' 'r'

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

4   Fail
clear board board(:,:,1) = ['rrbrrbr';'rbrrrrb';'brrrbrb';'rbrbrrr';'rbrbrbr';'brrrrbr']; board(:,:,2) = ['brbbbrb';'rbbbbbr';'bbrbrbr';'brbrbrr';'rbrrbbr';'brbbbbr']; %blue wins 25 to 17 assert(isequal(rumis_scorer1(board),'b'))

ans = 42×1 char array 'b' 'r' 'b' 'b' 'r' 'b' 'r' 'b' 'b' 'r' 'b' 'r' 'b' 'b' 'r' 'b' 'r' 'b' 'b' 'b' 'b' 'r' 'r' 'b' 'b' 'b' 'r' 'b' 'b' 'b' 'r' 'b' 'b' 'r' 'b' 'b' 'b' 'r' 'r' 'r' 'r' 'r'

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

5   Fail
ind = randi(4); 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_scorer1(board),'b')) case 2 clear board board(:,:,1) = ['brbrb';'rrrbb';'bbrbb';'bbrrb';'bbrbr']; board(:,:,2) = ['brbrb';'rrbbr';'bbrbr';'brbrr';'rbrrr']; assert(isequal(rumis_scorer1(board),'r')) case 3 clear board board(:,:,1) = ['brb';'rrr';'bbb';'brb';'bbr']; board(:,:,2) = ['brb';'rbr';'rbr';'brr';'rrr']; assert(isequal(rumis_scorer1(board),'r')) case 4 clear board board(:,:,1) = ['rrbrrbr';'rbrrrrb';'brrrbrb';'rbrbrrr';'rbrbrbr';'brrrrbr']; board(:,:,2) = ['brbbbrb';'rbbbbbr';'bbrbrbr';'brbrbrr';'rbrrbbr';'brbbbbr']; assert(isequal(rumis_scorer1(board),'b')) end

ans = 15×1 char array 'b' 'r' 'r' 'b' 'r' 'r' 'b' 'b' 'r' 'r' 'b' 'r' 'r' 'r' 'r'

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

6   Fail
ind = randi(4); 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_scorer1(board),'b')) case 2 clear board board(:,:,1) = ['brbrb';'rrrbb';'bbrbb';'bbrrb';'bbrbr']; board(:,:,2) = ['brbrb';'rrbbr';'bbrbr';'brbrr';'rbrrr']; assert(isequal(rumis_scorer1(board),'r')) case 3 clear board board(:,:,1) = ['brb';'rrr';'bbb';'brb';'bbr']; board(:,:,2) = ['brb';'rbr';'rbr';'brr';'rrr']; assert(isequal(rumis_scorer1(board),'r')) case 4 clear board board(:,:,1) = ['rrbrrbr';'rbrrrrb';'brrrbrb';'rbrbrrr';'rbrbrbr';'brrrrbr']; board(:,:,2) = ['brbbbrb';'rbbbbbr';'bbrbrbr';'brbrbrr';'rbrrbbr';'brbbbbr']; assert(isequal(rumis_scorer1(board),'b')) end

ans = 15×1 char array 'b' 'r' 'r' 'b' 'r' 'r' 'b' 'b' 'r' 'r' 'b' 'r' 'r' 'r' 'r'

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

7   Fail
ind = randi(4); 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_scorer1(board),'b')) case 2 clear board board(:,:,1) = ['brbrb';'rrrbb';'bbrbb';'bbrrb';'bbrbr']; board(:,:,2) = ['brbrb';'rrbbr';'bbrbr';'brbrr';'rbrrr']; assert(isequal(rumis_scorer1(board),'r')) case 3 clear board board(:,:,1) = ['brb';'rrr';'bbb';'brb';'bbr']; board(:,:,2) = ['brb';'rbr';'rbr';'brr';'rrr']; assert(isequal(rumis_scorer1(board),'r')) case 4 clear board board(:,:,1) = ['rrbrrbr';'rbrrrrb';'brrrbrb';'rbrbrrr';'rbrbrbr';'brrrrbr']; board(:,:,2) = ['brbbbrb';'rbbbbbr';'bbrbrbr';'brbrbrr';'rbrrbbr';'brbbbbr']; assert(isequal(rumis_scorer1(board),'b')) end

ans = 42×1 char array 'b' 'r' 'b' 'b' 'r' 'b' 'r' 'r' 'b' 'r' 'b' 'r' 'b' 'r' 'r' 'b' 'r' 'b' 'b' 'b' 'b' 'r' 'r' 'b' 'b' 'b' 'r' 'b' 'r' 'b' 'r' 'b' 'b' 'r' 'b' 'b' 'b' 'r' 'r' 'r' 'r' 'r'

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

### Community Treasure Hunt

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

Start Hunting!