Draft
Through the Maze
Loading description...
Arrays
Strings
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.
Very rarely, the random tests will generate mazes with no possible exit path, e.g.
which isn't supposed to happen.
nice kata tho :)
Inspections are disqualified for no reason I burned for three hours
duplicate
Seems very much a duplicate of other existing maze katas. Values array seems totally unnecessary. When I messed up values format, it gave me some cryptic message and didn't really help at all.
This comment has been hidden.
Hit the time limit, seems challenging :D
Most tests were working OK but some test cases were failing for me with weird errors. It took a very long time to work out that it was not my code, but rather the test verification which did not like me dropping breadcrumbs into the original maze matrix. Please fix the test code or document this restriction.
(Maybe same issue as the myjinxin2015 comment)
If you modify your input, you deserve whatever you get.
That said, it would be better to explicitly bite off your head for it.
Closing.
A little bug in random test, the maze array generation maybe use the Wrong clone mode, some lines are used to replicate the generation of other lines, so if you directly modify the maze array data in these line ,They will change together.
Sorry, but I haven't understood. Where do you get the bug?
a maze: w _ w w w w w w w w w _ w w w w w w w w w _ w w w w w w w w w a _ _ _ _ _ _ _ w w b _ _ _ _ _ _ _ w w c _ _ _ _ _ _ _ x w w w w w w w w w w
modified maze araay at a , then point b and c will Change together (my English so bad...)
I'm sorry but I still didn't fully get the issue... I have personally tried to randomly generate as many mazes as I could, but never encountered any issue.
I am unsure of the purpose of keeping track of values. The only valid option is an array full of
'_'
ending with'x'
. Is it to double check the number of steps people used? If that is the case, I think returning it as just a number is more clear. Putting'_'
repeatedly into an array seems redundant otherwise, and doesn't add much to the real problem of finding the path.Very good kata though, really has me thinking!
Thanks for the appreciation, Katbow! The array of values
'_'
ending with'x'
should be quite useful for the codewarrior to debug the solution. Getting the right path is the most valuable info of course, and most of the tests check the path rather than the array. But you still need to get the values array right to pass this kata.Hey franzmoro88, I'm almost there with my solution but I keep failing with these tests:
But my path array is:
[[0,0],[0,1],[0,2],[1,2],[2,2],[3,2],[4,2],[4,3],[4,4],[4,5]]
And my values are:
["_","_","_","_","_","_","_","_","_","x"]
As far as I know this seems like a valid solution. Are the tests only against the first maze (the one in the description) or are there others? When I log the output from
maze
I only get the maze from the description.Hi andrewMacmurray!
Ahhh that makes sense, will try it with some different mazes.
It looks a bit misleading when the errors come up as even loging the maze to the console doesn't show the random mazes generated (it just looks like it's saying the first maze is hitting a wall or never getting to x). Maybe you could update the tests to show the random mazes?
Great Kata, early beginnings of a game engine!
That's a great idea! I just remembered that CodeWars JS runs on Node, so I can just console.log the maze on Codewars! The only issue is that some of the 12 random mazes will be too big and cumbersome to be visualized properly in the console (up to 100x100 arrays!). I updated the cases so that the first two mazes (of fixed content and sizes) plus the random ones which will are smaller than 15x15 will be logged. Let me know if you find this reasonable.
Ahh forogt that N could go up to 100! (that would be a pretty ridiculous output!) could you add a conditional statement for the log? Something like
So that you wouldn't get the super huge mazes.
Yeah, that's what the tests have now (for
n<16
). I don't know what the optimumn
is.I see what you mean, just struggling to come up with a maze which fails my current code
For the moment I can increment n to 40. Worst case you can copy-paste the maze in a text editor on a large-enough screen (??).
Thanks! So this is an interesting output:
Is that intentional?
Hi franzmoro88, I noticed how in some of your random tests i'll get an error saying the path array should not start from [0,0]. But in the tests prior to the random tests it will say path array should start from [0,0]. Maybe have a look at these errors?
Yeah, the test was checking if your path was going in steps of 1, but the error message was wrong. I confirm that you do need to start from [0,0]. Thank you for spotting it out!