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.
Needs more tests, and random tests.
This comment is hidden because it contains spoiler information about the solution
Images are broken, wrong(wikipedia was never a commercial) links.
[I'll fix them, soon]
This comment is hidden because it contains spoiler information about the solution
This is actually because you didn't read the docs properly and see that
Test.expectError
expects a function argument. You have to wrap the call into a function.Input validation does not add to the problem. Please just don't.
Polygons with points in clockwise order are not tested.
Could somebody subtitle what the defining property of a curve "like this" is? I don't feel like reverse engineering it.
As with http://www.codewars.com/kata/point-in-polygon-1/
Polygons like these were not tested:
And I believe many solutions will fail on convex polygons like that.
Test.expectError
takes a function argument, which it calls and expects an error to occur. You're probably writing something like:rather than,
Note that the first way (the way that didn't work) is equivalent to this:
What's the point of saying a polygon can contain curves, if it can't really contain curves?
Again, I think the data structure add unecessary difficulty.
I feel like you should have three kata: point in poly (4kyu) bezier curve (5 kyu) and this easy kata (5/6 kyu) wich would use both previous kata. Here you chose to give an introduction to point in polygon but not bezier curve. So this kata is a bit misleading as one can think it is about points in a polygon but it is about bezier curves.
Nice kata. I don't get the point of adding lineto and moveto in the polygon description. I think an array of points would suffice.
OK, I was doing the latter, and wondering why it was recieveing the error, and then throwing another error. I should probably rewrite this. Thanks!
Hi wfleet, the
Test.expectError
call has worked for me in the past, so if I may ask, did you pass it a function that invokespointInPoly
or did you passpointInPoly
or its result directly? That is, was it like this:or like this: