Ad
  • Custom User Avatar

    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.

  • Custom User Avatar

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

  • Custom User Avatar

    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. :)

  • Custom User Avatar

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

  • Default User Avatar

    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.

  • Default User Avatar

    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.