Cody

# Problem 3054. Chess ELO rating system

Solution 1925709

Submitted on 8 Sep 2019 by Le Cong Hieu
• Size: 8
• This is the leading solution.
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
players = 1000; result = 1; assert(isequal(algo400(players,result),1400))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In algo400 (line 2) In ScoringEngineTestPoint1 (line 3) In solutionTest (line 3)]

2   Pass
players = 1000; result = 0.5; assert(isequal(algo400(players,result),1000))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In algo400 (line 2) In ScoringEngineTestPoint2 (line 3) In solutionTest (line 5)]

3   Pass
assert(isequal(algo400([2000 2000],[0.5 0.5]),2000))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In algo400 (line 2) In ScoringEngineTestPoint3 (line 1) In solutionTest (line 7)]

4   Pass
players = [2000 2000]; result = [1 1]; assert(isequal(algo400(players,result),2400))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In algo400 (line 2) In ScoringEngineTestPoint4 (line 3) In solutionTest (line 9)]

5   Pass
players = [2000 2000]; result = [0.5 1]; assert(isequal(algo400(players,result),2200))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In algo400 (line 2) In ScoringEngineTestPoint5 (line 3) In solutionTest (line 11)]

6   Pass
players = [2000 2100 2200 2300]; result = [1 0.5 1 0.5]; assert(isequal(algo400(players,result),2350))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In algo400 (line 2) In ScoringEngineTestPoint6 (line 3) In solutionTest (line 13)]

7   Pass
players = 1000; result = 1; assert(isequal(algo400(players,result),1400))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In algo400 (line 2) In ScoringEngineTestPoint7 (line 3) In solutionTest (line 15)]

8   Pass
players = [1399 1280 2166 1534 1768 1791 1540]; result = [1 1 0 1 1 0 1]; assert(isequal(round(algo400(players,result)),1811))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In algo400 (line 2) In ScoringEngineTestPoint8 (line 3) In solutionTest (line 17)]

9   Pass
players = [2000 2100 2200 2300]; result = [0.5 0.5 0.5 0.5]; assert(isequal(algo400(players,result),2150))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In algo400 (line 2) In ScoringEngineTestPoint9 (line 3) In solutionTest (line 19)]

10   Pass
players = [2772 2768 2877 2805 2787 2772 2768 2877 2787 2805]; result = [1 1 1 1 1 1 1 0.5 0.5 0.5]; assert(isequal(round(algo400(players,result)),3082))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In algo400 (line 2) In ScoringEngineTestPoint10 (line 3) In solutionTest (line 21)]