6 kyu
Shorter Path
373 of 606Nancy27
Loading description...
Fundamentals
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.
Java fork
.
What about the test which sends
[ "" ]
as input? Is an empty string a valid direction?@hobovsky
thanks for the report, fixed too
it returns this ['W', 'W', 'W', 'W', 'W', 'W', 'W', 'N'] should equal ['N', 'W', 'W', 'W', 'W', 'W', 'W', 'W'] randomly like an error, even when both solutions are correct. Now I have to figure out how to make my code adapt to the order of those random text 😐.
From the description:
ohhh, thanks. I didn't read that part. I'm YGO player.
python new test framework is required. updated in this fork
Approved
Python: The example tests and test suite aren't using the test framework, missing the imports (user's solution + framework).
done by OP
C#: method name should be
PascalCase
(Please refer to implementation of backward compatibility here )Awesome kata actually, was amazed by the solution page, Nice simple beauiful solutions, mine was rather complicated!! :-( Thanks Nancy27
"If you get back to beginning, return an empty array." - there is wrong test written in Sample Tests. It assumes that when you go to the beggining, you return not an empty array but an empty string so that the array length is = 1... Please correct that.
Java requires an array with an empty string, other translations an empty array. This should be fixed.
duplicate of this issue
here is a proposed fix
Python test results seem reversed.
['S'] should equal []
should equal[] should equal ['S']
...Fixed.
I also prevented input modification changing the test results and made the random tests into a loop (the author wrote really crappy Python code there).
This comment has been hidden.
That's a question, not an issue.
Don't mutate the input object. If you must, copy it first.
sorry the issue is when I run this code in my com it's give the right output but here it gave me wrong output and every time I try it gives another output the wrong output exactly in the sorting of the list
Closed the previous issue while I shouldn"t have, so here it goes again...:
Java tests are not consistent with the python version:
Python does the right move, here. Should be new String[0] for java.
And same problem for the inverted test: the input with new String[] {""} is not an empty array so is invalid. Python sends a real empty list [] instead.
And DM comments:
proposed fix
.
Hi,
Java tests are not consistent with the python version:
Python does the right move, here. Should be
new String[0]
for java.And same problem for the inverted test: the input with
new String[] {""}
is not an empty array so is invalid. Python sends a real empty list[]
instead.Agree. Irrespective of python, it is just not sensible
corrected in the meantime, thx!
Damn me!! Not corrected. Reopening, so... :/
JS translation kumited.
; ) )
Random tests still broken.(java)
I guess there is some kind of mistake with random tests (java). for example: input array: E E W E N N S N N N my output array: N N N N E E this is what tests say: array lengths differed, expected.length=3 actual.length=6
input array: E S S E E W N S N W my output array: S E this is what tests say: array lengths differed, expected.length=4 actual.length=2
input array:N N E E S W S E S E my output array:S E E E this is what tests say: array lengths differed, expected.length=6 actual.length=4
and besides as far as i understand if you stay on the same place the function should return an empty array (length=0) but the tests demand it to return the array with one empty string (length=1).
Yes, they seem broken. No wonder there is only one Java completion of this kata.
E.g.:
[E, N, E, W, S, N, N, N, S, W]
✘ arrays first differed at element [0]; expected:<[S]> but was:<[N]>
This comment has been hidden.
Fixed
nice kata!
Why in test ['S', 'S', 'N', 'E', 'W', 'N', 'W', 'S', 'E'] ['S'] should equal ['N', 'S', 'S']?
It looks like your random tests in the C# instance are broken.
For instance with an input of WWESWS, I expected SSWW but the test says it is expecting S
Not an issue.
Read the descriptions ;-)
In the C# instance, your test cases should be CollectionAsserts, not Asserts.
Fixed
Random tests doesnt work, atleast in my opinion
Which language are you talking about?
java, i was checking input(tests were failing) and then wrote tests in my IDE with same input and they where passing Maybe i did something wrong but i checked it few times
I think I may have reversed the expected and actual results. I removed the java translation, and now I am trying to re-publish it, but I'm getting errors...
Looks fixed
Isn't this a duplicate of http://www.codewars.com/kata/directions-reduction?
It's close but not the same, for that one, the opposed directions have to follow each other in the list to cancel out. This one they don't have to.
expect, in tests there are some mistakes [W, N, W, N, W, E, N, N, N, N, N, S, N, S, W, S, N, N, E, W, W, W, E, N, N, E, E, N, N, S, N, W, N, W, N, S, E, N, W, E, E, W, N, S, N, W, S, E, E, W, E, S, E, N, E, N, N, E, S, S, E, E, S, S, N, S, N, E, E, W, N, S, E, W, W, N] {S=14, E=19, W=16, N=27} NNNNNNNNNNNNNEEE len=16 [N, N, N, N, N, N, N, N, N, N, N, N, N, E, E, E] array lengths differed, expected.length=16 actual.length=17
I put the array into my own code and by hand and got a length of 16. I don't know where the 17 is from. Is this the python version?
Java Almost all tests were passed. But in last random tests are problem.. [W, E, N, W, E, W] {E=2, W=3, N=1} len_string=2 NW len_array=2 [N, W] array lengths differed, expected.length=2 actual.length=1
I'm currently fixing the java translation, just having problems with the site right now.
thank's! we are waiting for)
Java
is still brokenThis should've passed but failed the random test
Description says return an empty array but example test is expecting
new String[]{""}
. That aint no empty array. That's an array with 1 empty string in itGood kata. The great thing is that it can be solved with many different code, for simplest to smartest. Thanks.
Thanks! Ya it's interesting to see the many ways it can be solved.
Good kata. Thanks.
Thank you! :)
Perhaps you should add more tests. Specially random ones. If you do so, you'll have it soon in approved status.
I added some more test cases, thanks!