Ad
  • Custom User Avatar

    Still fails some large random tests. I tried to add in the console log near the end of the code, but then it kept passing the random tests on muliple tries. Whatever problem is here will show up on the harder version.

  • Custom User Avatar

    I appologize for submitting cheating code, but I had given up at that point and just wanted to get it over with. Two different approaches passed different tests, and the later approach passed all but test 32 and occasional random tests. I didn't want my old code to go to waste, so I hard coded a diversion and executed 32 with the old approach. Then I had to resubmit over several random tests before I got lucky and passed. Looking at everyone else's code did not help, because I can't make heads or tails of code with different approaches than mine, but then I figured out a refinement that passed test 32 and failed some others. A further tweak passed all the fixed tests but failed some of the large random tests. I tried to code in some console logs to figure out what was going on, but then the code kept passing the random tests. So I gave up (again) and submitted code that fails some random tests. On to the cyllendrical version!

  • Custom User Avatar

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

  • Custom User Avatar

    The fact that others have passed this challenge means they futzed with their code enough to pass the tests and didn't give it a second thought, but it seems counter to the instructions to me.

    To be frank, it's rather bold to assume that your code is the only correct one and that the other 200+ coders who have passed this kata are wrong. And, while I generally prefer not to bring up rank as a heuristic justification, many of those who've passed are higher-rank coders on this platform while you're a 5kyu with less than 50 katas under your belt (most of which are white and yellow katas), a fact which would cast doubt on your claim.

    This is not meant as a jab to diminish your competence as a coder. Oftentimes mistakes occur because some detail in the Description may not have been read or interpreted correctly, or a user makes an assumption about the rules that was never implicitly or explicitly stated (e.g. integers are mentioned and they assume only positive integers are involved).

    It seems you've spent a considerable amount of effort working on this kata. Whether or not you pass it, hopefully you gain something positive from it (even if not the honor points).

  • Custom User Avatar

    That wasn't my main concern. My main concern was that a test of having a 2 in the center of a square of 1s was clearly moving in the wrong direction in the code that actually passes the basic tests and it wasn't favoring angles the clockwise direction as stated in the instructions. The fact that others have passed this challenge means they futzed with their code enough to pass the tests and didn't give it a second thought, but it seems counter to the instructions to me. It is too late to fix without invalidating everyone's code, so perhaps the only thing left to do is mark the challenge as a puzzle.

  • Custom User Avatar

    Ok, marking issue as resolved then.

  • Custom User Avatar

    That part is fixed now, and I'm back to regular bugs. I wasn't handling classes and constructors properly

  • Custom User Avatar

    I think that's the problem. My final solution code is failing without any of the console logs appearing. It's failing in a fundamental way different from the test cases and I don't know why.

    screenshot? (the output panel)

  • Custom User Avatar

    Is this issue valid? Looks like others are successfully completing this kata (albeit after some considerable effort).

  • Custom User Avatar

    For what it's worth, here's my current issue. I'm passing most of the tests until this one.

    original

    1 . . . . .
    . . . . . .
    1 . . . . 2
    

    expecting

    1 . . . . . 
    . . . . . .
    1 . . . 2 .
    

    my code:

    1 . . . . .
    . . . . 2 .
    1 . . . . .
    

    This makes sense. It's more natural to move in an orthogonical direction, all things being equal. So I added a way to give priority to straight diagonals and ortho moves. Now my code, which passed the basic test before, has this error.

    Original

    . . 5
    4 . .
    . . 4
    

    expecting

    . . .
    . 9 4
    . . .
    

    my code:

    . . . .
    . 4 5 4
    . . . .
    

    (Yes, I know the 4s are moving too, but it's the 5's movment that is important.) The 5 is making a direct ortho move down to the 4, which is the same distance away as the other 4, which would require a zigzag to reach (if it held still).
    So I wonder how the test can hold two conflicting moves as true at different times. Either direct paths get priority or they don't. Or it's something else that I haven't figured out. I'm programming in JavaScript.

  • Custom User Avatar

    I'm only a 5 and I need to rank up before higher value solutions are available to me. But at least I got the class problems ironed out and I am back to doing real debugging now.

  • Custom User Avatar

    Trigonomitry isn't necessary for this challenge. dfhwze below practially gave away the answer.

  • Custom User Avatar

    I think that's the problem. My final solution code is failing without any of the console logs appearing. It's failing in a fundamental way different from the test cases and I don't know why.

  • Custom User Avatar

    At this point I would love to give up, but the "Unlock Solutions" button is now missing.

  • Custom User Avatar

    I found the bad input by logging to the console input data to populate, move and constructor (NaN, boolean, string, out of bounds)

  • Loading more items...