Earn extra honor and gain new allies!
Honor is earned for each new codewarrior who joins.
Learn more
  • 14909989?v=3
  • 18171520?v=3

    Could somebody subtitle what the defining property of a curve "like this" is? I don't feel like reverse engineering it.

  • 14909989?v=3

    Added the relevant information.

  • 7734?v=3

    the coordinate system is completely unexplained (not only the azimuth, but where is east or north according to the axis, or around which axis the sun crosses the sky, or even which direction is up)

    the face definitions on the tests seems not consistently clockwise or counterclockwise (neither the instructions alert that they should be treated as double sided)

    a graphical debug helper would be nice, I make a crude one on my solution.

  • 7734?v=3

    Changed to "the function tick() will be called a few times between and after the sends", is it better?

  • 4389118?v=1

    You need to better explain how and when tick() is called.

  • 7734?v=3

    I think I kinda miss the 1kyu problems :)

    And, as I don't know the kyu a beta kata is intended for, I frequently remark these things, just in case.

    Nice kata, anyway. :)

  • 12381126?v=3

    Thanks for your support!

  • 12381126?v=3

    Is it a question or an issue? I suppose it's a question.
    I think that the numbers are correct. One needs everybody to make a world, not only "1kyu":-) More, nobody prevents you to give a non pretty weak solution or to fork the existed one to have stronger tests though in JS one doesn't go very far with large numbers.
    Don't worry, I am only teasing you:-)
    Honest answer: yes, it was intentional. You can look at other katas I wrote and see if a weak solution will pass.

  • 7734?v=3

    This comment is hidden because it contains spoiler information about the solution

  • Profile-pic

    As with http://www.codewars.com/kata/point-in-polygon-1/

    Polygons like these were not tested:

    var thisPolygon = {'polygon' : [
            {'moveto' : {'x' : -5, 'y' : -5}},
            {'lineto' : {'x' : 5, 'y' : -5}},
            {'lineto' : {'x' : 0, 'y' : 0}},
            {'lineto' : {'x' : 4, 'y' : 4}},
            {'lineto' : {'x' : 3, 'y' : 1}},
            {'lineto' : {'x' : 1, 'y' : 0}},
            {'lineto' : {'x' : 5, 'y' : 0}},
            {'lineto' : {'x' : 5, 'y' : 5}},
            {'lineto' : {'x' : -5, 'y' : 5}},
            {'lineto' : {'x' : -5, 'y' : -5}},
    thisPoint = {'x' : 1.01, 'y' : 1};
    Test.assertEquals(pointInPoly(thisPolygon, thisPoint), false, 'Point is outside the polygon');
    thisPoint = {'x' : 0.99, 'y' : 1};
    Test.assertEquals(pointInPoly(thisPolygon, thisPoint), true, 'Point is inside the polygon');

    And I believe many solutions will fail on convex polygons like that.

  • Profile-pic

    Great Kata!

    But there is a problem in the benchmark:
    Took too long: Infinityx as long as allowed.
    Are you using process.hrtime() to measure it?

    There's also a rounding problem in this message:
    Took too long: 1.0x as long as allowed.
    At this point the user would think the job was done.

    And I agree with the comments that the final run results should be tested, not only benchmarked. Even if you can't run your code to cross check it, you could somehow generate the points from the circles you are going to test later, so you could know the results a priori.