Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Yes. This code returns a boolean value and not a string.
Fixed
Elegant.
There are no problems with the last set of tests. Since state is not preserved:
I encountered this same problem in JavaScript. It's the second test spec in the 'State isn't preserved' suite of tests.
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).
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 toadd
, but the expected result is 10 when it should be 6 - again, according to the examples.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...
Not a problem, hope you enjoyed :-)
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.
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.
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:
The answer to this line:
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?
Can we please get this fixed? It's been a year since this issue was raised.
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?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...