Cody

# Problem 42674. Cody meets Xiangqi: foresee the unseen (Part 1)

Solution 846274

Submitted on 8 Mar 2016 by Richard Zapor
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
% By courtesy of Alfonso Nieto-Castanon urlwrite('https://sites.google.com/a/alfnie.com/alfnie/software/SetSolutionScore.p?attredirects=0&amp;d=1','SetSolutionScore.p'); rehash path;

2   Pass
fh = fopen('EvaluateSolution.p','wb'); fwrite(fh, hex2dec(reshape('7630312E30307630302E3030000E601C0AF25FB100000056000000A4000000D6820EB5B30514117A9E6E5DB36898AFFFCC5086DFAF59C2910AEB07B88523DABE546868AC2BDAC3795467A7BCD91A89E2F578F2EDE92D63472A3B8FCA3F216CB3B66B010B5B924A5F514E19B90225B0978A54DA881119917D211CB055361918CAA0670F6D0E8ED17B319492619F4361BFB4C3C31D68E11F4BA084C6456783C358296B3E63E16C78EF2B0279074BCB707265EB4C044BFF7F25BA0A9678B75D36B9ACEE6853',2,[]).')); rehash path; fclose(fh);

3   Pass
p = 0; Na = 2; Nb = 3; AbsTol = 1e-6; RelTol = 1e-5; sol = Xiangqi(p, Na, Nb); assert(EvaluateSolution(p,Na,Nb,sol,AbsTol,RelTol));

4   Pass
p = 1; Na = 3; Nb = 2; AbsTol = 1e-6; RelTol = 1e-5; sol = Xiangqi(p, Na, Nb); assert(EvaluateSolution(p,Na,Nb,sol,AbsTol,RelTol));

5   Pass
p = 0.4; Na = 2; Nb = 3; AbsTol = 5e-4; RelTol = 5e-4; sol = Xiangqi(p, Na, Nb); assert(EvaluateSolution(p,Na,Nb,sol,AbsTol,RelTol));

6   Pass
p = 0.7; Na = 4; Nb = 2; AbsTol = 5e-4; RelTol = 5e-4; sol = Xiangqi(p, Na, Nb); assert(EvaluateSolution(p,Na,Nb,sol,AbsTol,RelTol));

7   Pass
p = 0.15; Na = 4; Nb = 2; AbsTol = 5e-5; RelTol = 1e-6; t = builtin('tic'); sol = Xiangqi(p, Na, Nb); score = builtin('toc',t); assert(EvaluateSolution(p,Na,Nb,sol,AbsTol,RelTol)); SetSolutionScore(round(500*score));