For instance, if you ask me to write a program that computes the first 100 digits of pi, I can just have it print a string literal.
Anything that has no inputs, or that has a small input space, or that is known to be tested with only a few known input cases, can be cheated by cooking the output.
A "cheat-resistant" way to verify that something is working is to choose problems that have a large input space, and randomly probe the space.
Famous examples of this kind of cheating have occurred in compiler benchmark. A compiler can recognize that the program being fed to it is a known benchmark, and produce an optimization of the benchmark as a whole. I.e. "if the abstract syntax tree of 279 nodes is exactly this particular one, spit out this canned piece of code which 'translates' it."
STDOUT/IN based challenges cause developers to have to program esoteric challenges that they would never see in real life, and write code that they would never use for anything other than a challenge site.
then if you have the most "stolen" or hacked points you can boast your haxxor skillz.
But also like James T Kirk, he was banned for cheating after beating the test. :)
(Rather than the bit where they found a way of cheating at Codewars. Also, does that still work, or have the Codewars people now patched the bug?)
[0] - http://imgur.com/a/QC1gf
The code does not execute properly. Try to figure out why.
int multiply(int a, char *b) {
return a b;
}WTF? Who the hell multiplies a char pointer with an int? Why not just a char? Do I need to multiply the pointer address or the value the pointer points at? Do I need to check for NULL?
Why not write proper code instead of solving these "puzzles"?
Your comment is exactly the point of the puzzle. Change char to int and you gain access.
"Ruby is love, ruby is jazz."
Yeah. No, thanks.
Thus, every time the reference result is compared against the result of his solution, both are considered equal, leading the validator to conclude that the solution is valid.
Code wars was loading up the solutions as modules, running them with data, then checking the returned result using the == operator.
Paul-Armand Assus changed the way the == operator functioned so it would always return true.
Then the checks would pass without any actual solution code.