Hacker News new | ask | show | jobs
by greyfox 3278 days ago
I read the blog post but I didnt quite understand it. Specifically the coding part. Can someone break it down for the noobs please?
2 comments

His solution always returns nil, and forces all comparisons with nil to be true.

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.

Ruby is a very dynamic language where other parts of code can change fundamental operators.

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.