Cody

Problem 45239. Checkmate-02

Solution 2136813

Submitted on 22 Feb 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
r = 'Kd4'; p={'Qe3','Rh3','Nc1','c6'}; pos = {'Kd5','Kc4'}; assert(isequal(checkmate_2(r,p),pos))

m = 99 54

Output argument "pos" (and maybe others) not assigned during call to "checkmate_2". Error in Test1 (line 4) assert(isequal(checkmate_2(r,p),pos))

2   Fail
r = 'Kg6'; p={'Qe3','Rh3','Nc1','c6','Ke7'}; pos = []; assert(isequal(checkmate_2(r,p),pos))

m = 75 101 55

Output argument "pos" (and maybe others) not assigned during call to "checkmate_2". Error in Test2 (line 4) assert(isequal(checkmate_2(r,p),pos))

3   Fail
r = 'Kc8'; p={'Qe3','Rh3','Nc1','c6','Ke7','h5','Ba6'}; pos = {'Kc7','Kb8'}; assert(isequal(checkmate_2(r,p),pos))

m = 66 97 54

Output argument "pos" (and maybe others) not assigned during call to "checkmate_2". Error in Test3 (line 4) assert(isequal(checkmate_2(r,p),pos))

4   Fail
r = 'Kh1'; p={'Qa3','Rb3','Nf2','c6','Kf7','h5','Ba6'}; pos = {'Kh2','Kg2','Kg1'}; assert(isequal(checkmate_2(r,p),pos))

m = 66 97 54

Output argument "pos" (and maybe others) not assigned during call to "checkmate_2". Error in Test4 (line 4) assert(isequal(checkmate_2(r,p),pos))

5   Fail
r = 'Kg6'; p={'Qe3','Rh3','Nc1','c6'}; pos = []; assert(isequal(checkmate_2(r,p),pos))

m = 99 54

Output argument "pos" (and maybe others) not assigned during call to "checkmate_2". Error in Test5 (line 4) assert(isequal(checkmate_2(r,p),pos))

6   Fail
r = 'Kd4'; p={'Rh2','Na1','d1'}; pos = []; assert(isequal(checkmate_2(r,p),pos))

m = 100 49

Output argument "pos" (and maybe others) not assigned during call to "checkmate_2". Error in Test6 (line 4) assert(isequal(checkmate_2(r,p),pos))

7   Fail
r = 'Kb2'; p={'Na2','Na1','Na3'}; pos = []; assert(isequal(checkmate_2(r,p),pos))

m = 78 97 51

Output argument "pos" (and maybe others) not assigned during call to "checkmate_2". Error in Test7 (line 4) assert(isequal(checkmate_2(r,p),pos))

8   Fail
r = 'Kb2'; p={'Na2','Na1','Na3','c1','c3'}; pos = []; assert(isequal(checkmate_2(r,p),pos))

m = 99 51

Output argument "pos" (and maybe others) not assigned during call to "checkmate_2". Error in Test8 (line 4) assert(isequal(checkmate_2(r,p),pos))

9   Fail
r = 'Kb2'; p={'Na2','Na1','Na3','Bg7' }; pos = 'checkmate'; assert(isequal(checkmate_2(r,p),pos))

m = 66 103 55

Output argument "pos" (and maybe others) not assigned during call to "checkmate_2". Error in Test9 (line 4) assert(isequal(checkmate_2(r,p),pos))

10   Fail
r = 'Kg6'; p={'Nf5','Rg1','g4','Qe2','Bf1','Kc3' }; pos = {'Kh7','Kf7','Kf6'}; assert(isequal(checkmate_2(r,p),pos))

m = 75 99 51

Output argument "pos" (and maybe others) not assigned during call to "checkmate_2". Error in Test10 (line 4) assert(isequal(checkmate_2(r,p),pos))

11   Fail
r = 'Ka1'; p={'Qa3','Rb3','Nf2','c6','Kf7','h5','Ba6'}; pos = 'checkmate'; assert(isequal(checkmate_2(r,p),pos))

m = 66 97 54

Output argument "pos" (and maybe others) not assigned during call to "checkmate_2". Error in Test11 (line 4) assert(isequal(checkmate_2(r,p),pos))

12   Pass
filetext = fileread('checkmate_2.m'); assert(isempty(strfind(filetext, 'regexp')),'regexp() forbidden') assert(isempty(strfind(filetext, 'regexprep')),'regexprep() forbidden') assert(isempty(strfind(filetext, 'strfind')),'strfind() forbidden') assert(isempty(strfind(filetext, 'strcmp')),'strcmp() forbidden')