6 kyu
Custom sort function
1,062 of 1,254lunitik
Loading description...
Sorting
Arrays
Algorithms
Restricted
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.
CS new test framework
JS new test framework
Nice kyu
Coffeescript is broken for unknown reason
It appears to want to wrap the array and sometimes the elements to strings before comparing to the reference solution.
Is it possible to reject an approved translation? Really annoying if you spend time solving this and it fails due to broken tests
Was going to fix the tests but since I cant solve the kata due to the errors I cant fix it.
Seems to be identical to this issue which @Voile fixed.
It's now fixed.
This comment has been hidden.
This cannot be reliably fixed. Disabling everything that could conceivably be used to cheat won't leave enough functionality to solve the kata, and cheaters will still find a way.
Cheaters gonna cheat. Nuke them from orbit.
Closing.
Kata fixed since site change made at https://github.com/Codewars/codewars.com/issues/1010
Haskell fix later, currently at work :P
Also added random tests for JS version.
Haskell version is now fixed. Cheers :D
Haskell and JavaScript occured the same issue. Can it be fixed?
Fixed
My answer is correct but I fail nearly all test cases because Called sort([1, 3, 2]) - Expected: '[1, 2, 3]', instead got: ''[1, 2, 3]''. It is so broken and needs to be fixed.
Me too...
This is the first approved kata that I haven't been able to complete... how did it come to pass that both the Haskell and Javascript tests are faulty?
Fixed
Okay, I figured out why this kata is broken, The internal check is borked:
So basically the check is checking a string against an array.
Besides, this kata's check is full of wtf anyways because:
Test.assertSimilar
basically callsTest.assertEquals
but applyingTest.inspect
to both sides;I guess the only way to solve this right now is to overwrite
Test.inspect
somehow.Fixed
This comment has been hidden.
Fixed
Thanks.
Called sort([1, 3, 2]) - Expected: '[1, 2, 3]', instead got: ''[1, 2, 3]'' Fix the tests for this Kata These slashes are not part of the output from the function
+1 (Javascript), are the tests wrapping the response somehow?
+1 Javascript has the same problem:
✘ Called sort([1, 3, 2]) - Expected: '[1, 2, 3]', instead got: ''[1, 2, 3]'' ✘ Called sort([1, 3, 2, 3, 4, 1]) - Expected: '[1, 1, 2, 3, 3, 4]', instead got: ''[1, 1, 2, 3, 3, 4]'' ✘ Called sort([4, 1, 3, 2, 2, 3, 4, 1]) - Expected: '[1, 1, 2, 2, 3, 3, 4, 4]', instead got: ''[1, 1, 2, 2, 3, 3, 4, 4]''
I'm facing the same issue. My answer is correct but it becomes a string so the test fails.
Fixed
Expected: '[1, 2, 3]', instead got: ''[1, 2, 3]'' How to deal with these slashes? -_- Dunno where they are coming from.
Facing the same problem - seems like an issue with the kata.
Same problem here... Called sort([1, 3, 2]) - Expected: '[1, 2, 3]', instead got: ''[1, 2, 3]''
This comment has been hidden.
I added random test cases along the way I was fixing the kata.
Test harness for haskelll has an issue as reported below. If there's a way to contribute code to have the issue fixed I don't mind helping to have it fixed.
yes, any way to contribute and fix this problem ?
"I would like to report a duplicate issue."
Closing.
Haskell tests fail, because
sort []
shouldBe[]
is ambiguously typed.The same issue is reported below by @muesli4.
Same issue here
Issue can be fixed smth like it, for pre-tests sort ([] :: [Int])
shouldBe
[]Still not fixed...
When will this issue be fixed for Haskell :( :(
I have the same issue. Please fix it :)
Likewise
same here ....
Some 9 months later, nothing happened.
I don't know how many months has passed, but the problem with Haskell stills. Can anybody do something?
The author of this kata, lunitik, needs to implement the fix. He hasn't been active in over a year. I want to contact him, but I don't know how to message users on this site...
Fixed
Haskell test cases are not running through because the tests are ambiguously typed. (I have no idea how this passed.)
Example:
I wish it will be fixed soon
To be honest, I highly doubt it. In 90% of the cases, you simply get no reaction. This behaviour is also enhanced by the Kumitee feature, people translate a Kata and then never look at it again (probably because they are not directly associated with it, which is wrong in my opinion).
I have a big list of Katas I simply could not complete, because something needs to be fixed.
Try to mark your question as an issue, seems like it can get some reaction then. I also can't finish this kata.
How dou you do that? It seems to me, the Codewars system itself is part of the issue.
Fixed
Thank you!
ARGH the "code timeout" happens before my bogosort implementation is able to sort anything!!!
Best sort in the world xD
This comment has been hidden.
The test harness has a bug
should be
To be safe from in place sorting, items should be copied
Thanks. It should be fixed now.
Either the error messages are confusing or the tests are wrong
This doesn't make any sense, surely
sort([1,2,2])
should return[1,2,2]
Cannot attempt, got: Test:Error: Expected sort([]) to return [1,2,3] Wtf?!
Please port to ruby! This is a nice kata.
Hi, I just saw another kata that would need a hiding of the sort-method, mind to share how you did it?
Preloaded section:
thank you
One of the tests returned: "Expected sort([1,2,3,4]) to return [1,1,2,3,3,4]". Should it expect [1,2,3,4]?
No its actually testing an array that has duplicate values in it.