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.
(C#) Please update test cases, or tell me how I can.
They report user code results as "Expected" and the correct answer as "Actual". I believe this contributes to some of the "spam" issues from people misunderstanding.
Assert.AreEqual(PyramidSlideDown.LongestSlideDown(smallPyramid), 23);
should be:
Assert.AreEqual(23, PyramidSlideDown.LongestSlideDown(smallPyramid));
etc.
Thank you very much!
Your explanation about pure functional programming is helpful. The whole Kata makes a little more sense in that light.
I read the description and it looks great.
For anyone reading this in the future - Voile fixed the tests. Thank you!
For anyone reading this in the future - Voile fixed the tests.
For anyone reading this in the future - the tests are fixed.
(C#) Wonderful kata. I like the ways it made me have to think.
May I suggest a couple areas where the explanation could be clearer? They were not difficult to overcome thanks to the extensive tests, but learning "specifications" from the tests is less than ideal. :)
I was confused by the expectation in the tests that after reading (e.g. Take or Drop n items) from a stream, doing that again should return the exact same data. My assumption (and implementation) was that after I read a line from a file stream, etc. I would keep reading at the point where I left off i.e. forward-only, don't consume memory with what I've already read, etc.
I'm not saying everybody will have that assumption, but I don't think it is extraordinary.
I looked up Fibonacci numbers and turns out it is up to you to define if you want to start with 0 1, or with 1 1. I guessed wrong. :) Not a big deal, but a quick fix also.
Thank you again for an extensive and well thought out Kata.
Thank you! My code passed first time with the fixed tests.
Now to clean up the mess of diagnostics and experiments, and submit it. :)
Just explain how Decode("iK8ZHB[hY", 6) should produce "[[[[[[[[[".
Because I am passing tests by hardcoding such nonsense. There's no way it could round-trip.
@Voile: Both your code and the Kata test code is incorrect if the above is how your code decodes (and it must have done so to pass the tests).
And there's a 5kyu kata that is actually more complex:
"All that is open must be closed"
https://www.codewars.com/kata/55679d644c58e2df2a00009c
It requires handling an arbitrary set of "braces" passed in as input, handling some where open and close are identical (like quotes). And the input can contain non-braces.
How come the test case passes in an impossible to decode string?
I suspect a clever algorithm is being used to solve these, but it doesn't choke on this special case...
It looks like invalid input for the test. What am I missing here? Follow my logic...
A test calls this:
Kata.Decode("iK8ZHB[hY", 6)
This should be the last column of the matrix when the rotated variants are sorted, and the 6th row is the original.
Sorting the input string should provide the first column:
8BHKYZ[hi
However, this results in an impossible situation:
8...i
B...K
H...8
K...Z
Y...H
Z...B
[...[
h...h
i...Y
All the characters are unique and yet two lines start and finish with the same character - impossible.
Should the sort not be ordinal? If so, what sort is desired?
When the random tests detect a problem with a solution, the message returned is incorrect. Instead of saying what the expected output should be, they provide a bogus string.
When I come back and solve the Kata, I'll look at the test code and identify the specific problem.
It's good to know the underlying tests pass. That means that the bug is just in the error messages returned when they do not pass.
I.e. they provide useless / misleading information when determining what bug in a solution they uncovered.
If I believe there are bugs in the Kata's tests, that is reason to file an issue, correct?
Until confirmation, I have filed my bug report as a Question.
The C# tests are broken or I have completely missed something about the Kata.
The tests report expected results that are impossible given the input. I.e. the output must be a reordering of the input characters, none added and none removed. Instead, results are expected that have one or more characters that do not exist in the input.
EXAMPLE A
Test logging shows: Kata.Decode("iK8ZHB[hY", 6)
Test output shows: Expected: "[[[[[[[[["
EXAMPLE B - notice that the expected has no semi-colon (';')
Test logging shows: Kata.Decode(";ZeC0d],:J}I", 8)
Test output shows: Expected: "]JdI}e:]JdI}"
Loading more items...