Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
They already exist, or they're never gonna.
Closing.
Is it really an issue? ;-)
Fixed
This comment is hidden because it contains spoiler information about the solution
In the case of -0, just add a 0 to it.
Still compilers tend to ignore that and return random values instead.
Encountered that behaviour often enough with GCC during code golfs.
There's still a rare problem though: division by +0 gives +Infinity and division by -0 gives -Infinity, and they are not equal.
bkaes: Thank you for the explanation and the randomized testing example, really appreciated. You should be listed as a collaborator for this kata.
I have now added randomized testing for all languages.
It returns a slope of Infinity (i.e., a vertical line) if only the denominator is zero, and a slope of NaN in the case of identical points.
This solution correctly handles both cases and returns true when all the slopes are infinity and false if only some are, while discarding NaNs. Try this input on lv.D's solution:
onLine([[1, 2], [1, 4], [1, 7], [1,7], [1,4]])
Fixed.
The main function returns 0 if there is no explicit return statement. It is standard C++.
This comment is hidden because it contains spoiler information about the solution
I'm not sure I follow your logic. Wouldn't submitting a solution like above basically require that you have seen the code for the tests? Guessing the tested params would be very improbable. Most kata on codewars do not do randomized testing and AFAIK it is not a requirement for having a kata "graduate" out of beta.
This comment is hidden because it contains spoiler information about the solution
I'm glad you like it :)
Loading more items...