3 ms·
I read the blog post but I didnt quite understand it. Specifically the coding part. Can someone break it down for the noobs please?
by greyfox 9y 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?
- strangecasts 9y agoHis 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.
- wmil 9y agoRuby 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.