Ad
  • Custom User Avatar
  • Custom User Avatar
  • Custom User Avatar

    at first, I wanted to set the condition in a different way. Inputing the string like '2x^2 + 4x + 5 = 0' and needs find roots. But i think that it hard for 7 kyu and for 6 kyu it not interesting to solve this kata.

    That you think, maybe make case of '2x^2 + 4x + 5 = 0' and gives it on 6 kyu?

  • Custom User Avatar

    There already are:

    Are you sure we need yet another matrix rotation task?

  • Custom User Avatar

    it looks alike but with differences:

    • spaces management
    • negative rotation
    • multi step rotation (n * 45°)
    • error management

    and as a kata suite, i think it's better suited for progression

  • Custom User Avatar

    Hello, not sure to understand. But is it related to "NameError: uninitialized constant Rotator" error?
    If yes, i've fixed it.

  • Custom User Avatar

    it looks alike but with differences:

    • spaces management
    • negative rotation
    • multi step rotation (n * 90°)
    • error management

    and as a kata suite, i think it's better suited for progression

  • Custom User Avatar

    Hi, thanks for the continued checking of the kata :)

    I don't remember fixing this, but it's fixed now, another thank you if you did it yourself.

  • Custom User Avatar

    I updated the test cases according to your suggestios. I encourage you to update Haskell translation accordingly.

    1. Change in Constraints Constraints set back to 500 but includes 0.
    0 <= x1, y1, x2, y2 <= 500
    0 <= len(commands) <= 500
    
    1. Four new test cases added in Sample Tests and Fixed Tests.
    2. Random test cases are now of random lengths. The len(commands) for each test case is calculated randomly.
  • Custom User Avatar

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

  • Custom User Avatar

    I added some index-predicated tests for all applicable methods now, although of course there's still just not a lot of tests in general. I mentioned the lack of index-predicated tests in the first discourse comment.

    You're right on fill, also push. I modified the kata description.

    I think all tests here are === as it should be (?), but maybe you're referring to python's === vs ==, in which case yes it looks like I'm checking itemwise by reference, which is what you would expect. But also yes, the tests are not currently making sure that e.g. map is not modifying the original array. Although that would affect the arr20 variable which would make subsequent tests fail. Theoretically it could be undetected for the last reduce test, but I think it's fine for a 5kyu.

    It might make sense to have a 4kyu kata about implementing all array methods exactly (including sort and negative slicing and thisArg), with all the fun behaviours. This is more of a "do you know which array method corresponds to which intention" test. In the description I do mention we're looking at common usages rather than exact replicas. Let me know if you think that should be made more obvious, or how to handle it

  • Custom User Avatar

    I wasn't aware of this reduce behaviour, fascinating! Fixed

  • Custom User Avatar

    Took care of enumerability. And good catch on the format bug, I must have been really tired :)

    Also checked that const push = [].push.call won't work, and I'm not 100% sure why. I wonder if there's other workarounds the user has, given that when user code first runs, array methods are accessible (just not when the functions are being called)

  • Custom User Avatar

    Great point on enumerability! I was just happy I got the concept to work, I didn't think about that.

    I saw [undefined] too on empty arrays and am not sure why. I figured it would be the format function but at first glance it seems ok. Unfortunately I have very limited time these days, if you have improvements and the time/will to implement them, please go ahead!

    I made the kata primarily so I could give a student an exercise I thought would benefit them, and was surprised something like this wasn't already on codewars. That purpose is achieved. For the sake of the codewars community I intend to work on this kata more until it's considered ready, but it might take a while.

  • Custom User Avatar

    Ok, thanks. console.log issue mostly fixed, and republished.

  • Loading more items...