4 kyu
Simple maze
776 of 1,042eugene-katsevman
Loading description...
Queues
Recursion
Algorithms
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
Haskell translation
python new test framework
Merged
Very nice one, compliments for the kata, well done.
nice kata
A very satisfying kata, thanks!
Very interesting kata. It wasn't clear at all that a non-rectangle maze may have extra escaping ropes, but it makes total sense!
Can someone give me a hint or something, please
Exquisite Kata! I always wanted to write a maze solver! Very Fun! Thank you eugene-katsevman!
This comment has been hidden.
I am not getting stack overflow with your code?
If you are indeed struggling with stack overflow, I would go in one of two directions:
My code passed all the sample tests then passed 99 of the test suite cases with 11 failed when I attempted it. Then 103 cases with 7 failed when I attempted it again with no changes to the code. How would I go about checking the errors when the test suite code is not available for me to debug my failed test cases against? Also why would the number of passed cases and failed cases change with no change to the code?
You can print(maze) to see the maze (Python). There are a bunch of random tests probably, so your tests change each time you run your code.
This comment has been hidden.
Firstly, thank you for this great challenge. It was fun!
I believe the instructions should be clarified. Saying the maze does not have to be a rectangle is not clear. It could mean either that you should treat blank spaces (e.g. last two chars in the last row, which has 8 columns where the others had 10) as walls or that you should treat them as edges where you've succeeded in escaping. I interpret it the first way, which caused me some confusion. Effectively, the maze always is a rectangle, it's just not always given as such in the input data. You have to extrapolate it into a rectangle.
My suggestion would be to say something like, "The maze input is not always a rectangle. Any spaces not defined by the input should be treated as open spaces (not walls)."
Hi,
So... Why not to use the "suggestion" flag, then?
Ah, because I believe the suggestion resolves an "issue". The issue is that the instructions are ambiguous.
well, I actually find it rather weird that you thought about "out of the array" as "walls" in the first place, considering the goal is to go out of that array.
i found it ambiguous too
Re:
well, I actually find it rather weird that you thought about "out of the array" as "walls" in the first place, considering the goal is to go out of that array.
The problem is not "out of the array". The problem is with "Note that the maze may not always be square or even rectangular."
Here is the issue When one considers that the maze is not rectangular, this means that the later array elements (i.e. a row of the maze) may be shorter than the earlier ones. But the question remains, when that row is shorter than the others, does it imply that the skipped columns (the right most ones) are blank spaces or are they '#'s? That's what needs to be clarified.
Does this help?
Awesome kata! I enjoyed it so much
Very pleasant kata: not very hard and lots of fun!
Good KATA:) boost my knowledge about reccursion
You could add a test case where there is no Kate. I realized that I missed this edge case after seeing a solution that didn't, yet I passed the kata.
I see that a test case exists for this in the two languages (Python and Java), so presumably someone has added that in.
If I remove the zero-kate-check from my Python solution then it fails to pass the test cases, as it should do.
So I'm going to consider this resolved.
Genial kata ♥I love you♥
thanks man :)
Though not Kata related, this Kata shows up in my profile under /Kata/Completed. I can't see the Solutions of the Kata however. If I resubmit my solution, do I get points again? I guess it's a CW bug, but is there an accepted way of handling this?
yes, known CW bug (reported on github). You effectively got double honor/progress for this. ;) (note: your soluiton is actually stored in your "profile/solutions" page)
python: the "jagged maze" test should be done with the reversed version too: some implementations may use the length of the first string as a constant, and that will make succeed that test where it would fail on the other version:
never thought about that, thanks!
java translation, please review and approve.
cheers
Note: I added the reversed jagged maze test and updated the description about that kind of maze.
.
The description should mention that the maze may not be a rectangle.
The description mentions that the maze may not always be square or even rectangular as of 17/05/2020.
This comment has been hidden.
This comment has been hidden.
Great Kata! Working really hard to solve this. Managed to go through Sample cases but my code times out when I run. What kind of sizes of mazes we are talking about ?
Mazes are not THAT big. May be your Kate is walking in circles?
What kind of exception is needed to satisfy this part of the description:
There should be only one Kate in a maze. In any other case you have to raise an exception.
The tester doesn't accept errors/exceptions I raise...
it is a mere Exception with the following message : "There should be no multiple Kates" exactly as in example tests
I believe this should be correct:
but this does not pass. I am not an expert on errors/exceptions...
Actually I think this passes and my issue is elsewhere. Sorry!
Hi there! Exceptions are not my forte - what is meant by "raise an expection if there is more than one Kate"? This doesn't do it:
Thank you!
no be -> be no a simple typo ;)
Eugene, thanks for looking into this. I guess my question is that my solution doesn't pass the sample test with "expect_error" or the actual test which looks for the error. I get this response:
What error are you looking for these cases?
bump
still no success?
I got it, thanks! Just have to read the error messages carefully; the little mistake was mine.
Python 3 support?
Would be great! Could you help me with that?
Sadly I can't edit the kata (or I'd have edited the kata myself).
You just need to replace all the divisions in
generate_maze
to the integer division one:I have republished the problem, not sure if I done in correctly, though.
Looks good now ;-)