Cody

Solution 1692558

Submitted on 14 Dec 2018 by HH
  • Size: 9
  • 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
x = 1; y = 1; assert(isequal(funny(x),y))

[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 funny (line 2) In ScoringEngineTestPoint1 (line 3) In solutionTest (line 3)]

2   Pass
x=2; y=[2 2 1]; assert(isequal(funny(x),y))

[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 funny (line 2) In ScoringEngineTestPoint2 (line 3) In solutionTest (line 5)]

3   Pass
x=5 y=[5 5 5 5 5 4 4 4 4 3 3 3 2 2 1]; assert(isequal(funny(x),y));

x = 5 [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 funny (line 2) In ScoringEngineTestPoint3 (line 3) In solutionTest (line 7)]

4   Pass
x=10; y=[10 10 10 10 10 10 10 10 10 10 9 9 9 9 9 9 9 9 9 8 8 8 8 8 8 8 8 7 7 7 7 7 7 7 6 6 6 6 6 6 5 5 5 5 5 4 4 4 4 3 3 3 2 2 1]; assert(isequal(funny(x),y))

[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 funny (line 2) In ScoringEngineTestPoint4 (line 3) In solutionTest (line 9)]

5   Pass
filetext = fileread('funny.m'); assert(isempty(strfind(filetext, 'if')),'if forbidden')

Suggested Problems

More from this Author1