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

    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

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

  • 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
  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

    For the first test, I see the 4 is moving toward the 3, not the 1. But the question on the 4th test still stands.

  • Custom User Avatar

    On the 4th test mentioned above, the 4 would make the movement if it were making a straight diagonal move (down, left) toward the three. It would be equally valid if it were making one diagonal move down, right toward the other 3, then down from there. When the rules say give priority to diagonals, they mean it.

  • Loading more items...