Problem 2390. Fair Scoring for Cody
The length-based scoring system for Cody has a few well-known loopholes that allow clever programmers to hide complex code inside certain functions so that it doesn't register in the score. This problem represents an attempt to generate a fairer Cody scoring function. It doesn't try to replace the length-based criterion with something more elegant; merely to eliminate places where longer code can be hidden and remain undetected by the scoring function.
I have included a few examples that I consider abusive to start with. These are just my own opinions. Please feel free to add your suggestions for others in the comments section for this problem, and I will add good ideas to the test suite when I have the time. Thanks for playing!
- regexp: count number of nodes inside (?@cmd) and add to total
- regexprep: count number of nodes inside {$cmd} and add to total
Using this scoring function, it might even be possible to allow use of eval.
- eval: count number of nodes inside argument to be evaluated and add to total
Other possibilities -- should str2num count the numbers inside its argument? Suggestions welcome! And if you support the idea of changing the scoring function along these lines, please 'like' this problem. Thanks!
Solution Stats
Problem Comments
-
10 Comments
And as a bonus, hacks would all have a high score, making them all the worst possible solutions. Never the leading ones.
I like your ideas in this regard, Rafael.
nice
Solution Comments
Show commentsProblem Recent Solvers7
Suggested Problems
-
15895 Solvers
-
2352 Solvers
-
Convert a numerical matrix into a cell array of strings
2060 Solvers
-
448 Solvers
-
99 Solvers
More from this Author11
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!