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

Solution Stats

0.75% Correct | 99.25% Incorrect
Last Solution submitted on Jul 19, 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!