• Custom User Avatar

    The failure messages for the random tests in Haskell are almost completely useless, as they don't show the actual/expected results. Additionally, they shouldn't rely on the Point type alias defined in the user solution.

    Fork

    While updating it, I went ahead and made some other improvements to test case generation.

  • Custom User Avatar
  • Custom User Avatar

    Both done in this fork

  • Custom User Avatar

    no answer from OP

  • Custom User Avatar

    I've just double-checked and both the author solution and the reference solution return false for the inputs [ [ 19, -24 ], [ 58, -70 ], [ 24, -31 ], [ -18, 18 ], [ 16, -25 ] ].

    Is this a recurring issue? Do you have another example?

  • Custom User Avatar

    the author's solution returns false for this input. when i try your solution, it incorrectly returns false for aligned points, e.g. [ [32,-66], [42,-82], [-18,14] ]

  • Custom User Avatar

    [ [ 19, -24 ], [ 58, -70 ], [ 24, -31 ], [ -18, 18 ], [ 16, -25 ] ]

  • Custom User Avatar

    Do you have an example of such test?

  • Custom User Avatar

    Random Tests in JS give points that are not part of the line and yet.. test want it to be TRUE

  • Custom User Avatar

    description should be language-agnostic

  • Custom User Avatar

    approved

  • Custom User Avatar

    JavaScript reference solution is very broken, failing to handle negative numbers or those with more than one digit. The fact that it works vaguely as intended is a lucky coincidence - but not always.

    onLine([[-6,-9],[-6,5],[-6,-2]]): expected true to be false

    onLine([[30,15],[36,18],[32,14]]): expected false to be true

    The author solution is also wrong, failing to differentiate between negative and positive gradients: onLine([[-11,-1],[-9,1],[-10,-2]]) === true. The fact that this passes the tests is again, dumb luck and insufficient test coverage.

    Finally, test generation is needlessly iterative, sometimes calling the reference solution 30,000 times to generate 100 random tests.
    Function call count for reference solution: 28582.

    Fork:
    https://www.codewars.com/kumite/667cbb20086a7f00f6dbc907

    Fixes:

    • Corrected author solution
    • Corrected reference solution
    • Added fixed tests to cover some missing cases
    • 10x random tests
    • Improved test generation speed by several orders of magnitude
  • Custom User Avatar

    on_line(((1,1))) should be on_line(((1,1),))

  • Custom User Avatar
    • Ruby 3.0 should be enabled

    • No random tests in Ruby

  • Custom User Avatar
  • Loading more items...