Problem 1764. singularity 2.0 (really hard)
This problem is the continuation of problem Singularity 2.0 (harder)
If you have been in Cody long enough you have probably run across some badly constructed problems and test suites.
This problem, I believe, represents the worst possible scenario. Yet, it is still possible to solve it. Do you know how?
Description:
This is this problem's testsuite:
%% x=1/ % oops... y=0; assert(isequal(myfunction(x),y));
As you may notice, the first line has a syntax error, so the testsuite will break at that point, and will return an error message:
??? 1/ Error: Expression or statement is incomplete or incorrect.
Typical hacks work by overloading some function in the evaluation code (e.g. assert hack). Unfortunately this error happens before the line that calls myfunction, so your function is not even being evaluated. It would seem there is nothing your function can do to avoid this error and pass the problem. Is there?
Solution Stats
Problem Comments
-
2 Comments
After an error ?
well, it was the worst possible scenario I could think of :) And just for reference, or perhaps a hint, the solution of this problem works just the same if the testsuite only contains the line 'x=1/;' and nothing else, not even a call to myfunction...
Solution Comments
Show commentsProblem Recent Solvers16
Suggested Problems
-
Create a function handle that reverses the input arguments of another function handle
157 Solvers
-
Back to basics 12 - Input Arguments
619 Solvers
-
Determine if input is a perfect number
257 Solvers
-
Find Index of maximum Value and maximum Value of a vector
167 Solvers
-
252 Solvers
More from this Author33
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!