fair scoring for cody -凯发k8网页登录
solution stats
problem comments
-
9 comments
i think this is a very interesting proposal.
so this kind of tricks still allowed in cody, but they will be counted in a fair way.
i used this a couple of times, and i think it is useful to learn this kind of coding methods, but it is not the real meaning of cody.
the most trick i used is the "str2num" one. to count all the numbers inside is a little bit hard, but i will accept this method also. it's fair! ;-)
i believe you need to redefine the 'newline' variable in all of your testsuite cases?
this is a very hard problem to solve in general. for example consider the following cases (the score in the first three cases should be penalized with additional 4 points, while in the latter three cases it should not): 1) regexp('',strcat('(?','@a=1)')); 2) str='(?@a=1)';regexp('',str); 3) regexp(' ',char(')@ab>2*'-1)); 4) regexp('',strcat('(?','a=1)')); 5) str='(?@a=1)';regexp(str,''); 6) regexp(' ',char(')@ab>2*' 1));
alfonso, thank you for your excellent thinking on this subject. you're quite right that an approach based only on parsing the program text would be hard to perfect. one could at least make people work harder to get around the scoring system! but what do you think of a different approach: modifying the definitions of regexp and its ilk on the cody machines so that they dynamically alter the score when called with eval-like arguments?
hi nicholas, that is a very good idea, the main problem would be to solve the correspondence between the different times regexp is called and the different times it might appear in the code, but perhaps using dbstack we could resolve this? (of course we could just penalize for each time it is called even if that might produce very high penalties for loops, etc.) thoughts?
the same regexp expression could potentially be called more than once with different dynamic code each time. it might be best to count the score of each unique code string from each separate invocation point -- that seems most in keeping with the spirit of the current rules. you're right that it would be quite complex to keep track.
thanks for pointing out the problem with newline, by the way. i think it is fixed now.
the easiest way would be to add a fixed size length penalty whenever using the regexp function, for instance, a 1000 points. when a problem requires the regexp function, every player would have the same penalty so it would be meaningless. and when the problem doesn't require it, the cody player would be disencouraged to use it.
ps: instead of banning functions, as cody currently does, a fixed point penalty for certain functions would disencourage their misuse while allowing players to fully explore matlab features.
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.
solution comments
problem recent solvers
suggested problems
-
5085 solvers
-
1939 solvers
-
115 solvers
-
581 solvers
-
44 solvers
more from this author
problem tags
community treasure hunt
find the treasures in matlab central and discover how the community can help you!
start hunting!