Ad
  • Default User Avatar

    THIS is for you, then...

    And the reason is pretty simple: the approach to use is "different"... (and don't discuss that sentence here, please ;) )

  • Default User Avatar

    I find it a pity that boundaries with 2 consecutive corners (++) are not tested; I see no reason why not, except that it would break some already submitted solutions.

  • Default User Avatar

    Strongly agree with this one. as it make the tryCode to be a simple function without the need of caching the previous guesses.

  • Custom User Avatar

    Nice little test. One bit was a little confusing.

    0 means the proposed digit is correct
    1 means the proposed digit is lower than the correct one
    -1 means the proposed digit is higher than the correct one
    

    Took me a few minutes and a number of attempts before I figured out I was reading it wrong. You migh be able to write a bit more clearly perhaps.

    But I enjoyed doing this one. Well done!

  • Custom User Avatar

    I absolutely agree with this. I think this would make for much more interesting algorithms, and a more realworld type scenario.

  • Default User Avatar

    @iamzuul, there are more than 3 different tests applied when you submit.

    You can see the test input if you log the argument to your function with console.log(...)

  • Default User Avatar

    Sure. Even worse; you have to construct an array representing the entire string before you visit the elements with reduce().

    It's a toy solution to a toy problem, but the straight forward imperative solutions are boring ;)

    I've submitted a boring solution as well now (with eager exit).
    http://www.codewars.com/dojo/katas/reviews/52774a314c2333f0a700068b/groups/528a437009e419289d000f20

    I've also submitted a tail-recursive solution, with eager exit:
    http://www.codewars.com/dojo/katas/reviews/52774a314c2333f0a700068b/groups/528a446509e419076d000f27

  • Default User Avatar

    @xDranik: randomising the order of the test might do the trick.

    @Bloodyaugust: no hard feelings, but I think it is clear that this is cheating in the same way it would be cheating to answer a math test in school by answers provided to you beforehand. In some cases (and katas!) the explicit goal is to pass the test-case, but in most the test-cases are merely there to validate that the solution meets the requirements for certain arguments.

  • Default User Avatar

    I think the calling sequence is backwards; the framework calls our function a number of times, with hints, in order to get a solution, but then we get the problem of the initial null guess.

    I'd prefer to providing the user with a "guess"-function (maybe as an arguemnt), to be called with the current guess, and having it return the indications, and then limiting the number of times this function may be invoked.

  • Default User Avatar

    I submitted a brute-force implementation by mistake ...

    I think the kata would be more interesting if you'd need something like a binary search to find a solution.

    Flagged with 'minor issues' due to this, but I'm not sure if that is in line with the protocol.

  • Default User Avatar

    Surely it's cheating; you're overfitting the function so it doesn't meet the requirements of the specification, only the test.

    I don't really care that you cheat, but it seems like a quite empty experience, and even if you gain some small amount of "honour" you gain no understanding and make no real progress.

    Your loss, the rest of us make do ;)

  • Default User Avatar

    Good! Then it's only a small matter of programming... ;)
    ( And the time to do it )

  • Default User Avatar

    The error message indicates that the solution fails for nthFibo(1) ( the 1-st Fibo ).

  • Default User Avatar

    This looks interesting!

    One question: are we guaranteed that the shapes will have an area?

    In other words, is this a legal shape:

    ++
    ++
    

    or is

    +-+
    | |
    +-+
    

    the minimum shape?

  • Default User Avatar

    I not an expert on the requirements of the various kyu levels, but level 4 is way off for this problem.

    The description for level 7 lists (among other things):

    • Iterating arrays and returning a subset of values
    • Basic data type manipulations

    which seems about right for this problem.

  • Loading more items...