Ad
  • Default User Avatar

    (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.

  • Default User Avatar

    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.

  • Default User Avatar

    For anyone reading this in the future - Voile fixed the tests. Thank you!

  • Default User Avatar

    For anyone reading this in the future - Voile fixed the tests.

  • Default User Avatar

    For anyone reading this in the future - the tests are fixed.

  • Default User Avatar

    (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. :)

    1. 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.

    2. 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.

  • Default User Avatar

    Thank you! My code passed first time with the fixed tests.

    Now to clean up the mess of diagnostics and experiments, and submit it. :)

  • Default User Avatar

    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).

  • Default User Avatar

    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.

  • Default User Avatar

    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...

  • Default User Avatar

    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?

  • Default User Avatar

    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.

  • Default User Avatar

    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.

  • Default User Avatar

    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.

  • Default User Avatar

    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...