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

    There are no problems with the last set of tests. Since state is not preserved:

    var add1 = curryPartial(add, 1);
    add1(2, 3) // (1) + 2 + 3 = 6
    add1(4, 5) // (1) + 4 + 5 = 10
    
  • Custom User Avatar

    I encountered this same problem in JavaScript. It's the second test spec in the 'State isn't preserved' suite of tests.

  • Custom User Avatar

    Which language are you encountering this problem in? I completed both the JavaScript and PHP versions myself without encountering any issues (except for following convention in PHP).

  • Custom User Avatar

    Looks like there's a bad spec, according to the examples you provided. Spec provides ultimately 4 arguments, but the function add being passed in only handles 3. My implementation takes those arguments without a problem and passes them all to add, but the expected result is 10 when it should be 6 - again, according to the examples.

  • Custom User Avatar

    They pass for me, so my guess is that you were working directly on the array (very bad practice), which now I prevented from affecting anything else.

    Also, so far 25 Rubyist completed it without further issues, so...

  • Custom User Avatar

    Not a problem, hope you enjoyed :-)

  • Custom User Avatar

    Yes, I see where my mistake was. Thanks for your patience. I'm fairly dense most days and this just goes to show it. Passed all tests. Thank you.

  • Custom User Avatar

    Hi @john129er. Please refer to the descriptopn If you reach the end point before all your moves have gone, you should return Finish

    Hope this helps.

  • Custom User Avatar

    I know that much already. My code accounts for a random starting and ending location, not fixed locations. Here's the issue. For this maze:

    maze = [[1,1,1,1,1,1,1],
            [1,0,0,0,0,0,3],
            [1,0,1,0,1,0,1],
            [0,0,1,0,0,0,1],
            [1,0,1,0,1,0,1],
            [1,0,0,0,0,0,1],
            [1,2,1,0,1,0,1]]
    

    The answer to this line:

    Test.assert_equals(maze_runner(maze,["N","N","N","N","N","E","E","E","E","E","W","W"]), "Finish")
    

    should be "Lost", not "Finish". This is one of the test cases when I push the "RUN EXAMPLES" button. But because I can see the test case, I can fix your bug so my code will run correctly.

    However, when I hit the "ATTEMPT" button, I pass all the random tests (with random sized grids and random start/end locations). But there is one non-random test that I get this output from:

    Should return Finish - Expected: "Finish", instead got: "Lost"

    It's the seventh test case, just before the program is run through a bunch of random test cases.

    I'm wondering if, like in the test case I have above, this other test case should be fixed also. I can't see the test cases after pressing the "ATTEMPT" button so I can't verify that it really is an error. I just find it highly suspicious that I can pass every other test, including random tests with random start and end points, but I can't pass that one.

    I'm asking you to review all the test cases to make sure that you didn't accidently put the wrong outcome.

    Does that make sense?

  • Custom User Avatar

    Can we please get this fixed? It's been a year since this issue was raised.

  • Custom User Avatar

    The test before it Test.expect(mazeRunner(maze,["N","N","N","N","N","N","N","N","N","S","S","S","S","S","S","S","S","S"])=="Lost", "Should return Lost") is expecting "Lost". You're not mixing it up with that are you?

  • Custom User Avatar

    Hi @john129er. Sorry for the confusion, I've updated the description to make it more clear. The start and the finish positions will change for the final tests.

  • Loading more items...