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!

See also http://www.mathworks.com/matlabcentral/cody/problems/2033-poll-would-you-like-the-regexp-cmd-functionality-to-be-banned-in-cody

Solution Stats

0.71% Correct | 99.29% Incorrect
Last Solution submitted on Dec 30, 2024

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers7

Suggested Problems

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!