Ad
  • Default User Avatar

    I renamed the parameters in the initial C# solution to m and n, as in the description. I think this is one of those cases where single letter variable names might be preferable. And I modified the error messages to refer to width and height, rather than length. Hopefully this will clarify things.

  • Default User Avatar

    Funnel. Gravity well. Square based pyramid contour lines. Journey to the centre of the square earth, that is flat, and stands on the back of 4 elephants atop a star turtle :)

  • Default User Avatar

    Would it make it easier to grok if it said "given c (number of columns) and r (number of rows) .." - I usually find it easier to talk about R and C when discussing 2D structures. I didn't have any problems understanding this kata's instruction but it was mainly the samples that I used to understand it rather than the description ("first and last row and column" isn't the clearest way of describing the 4 options of "first row", "last row", "first column", "last column" options, I think)

  • Custom User Avatar

    I mean, it can be just a language thing and feel free to ignore my remark if I happen just to be English-stupid. It's just that I had real problems determining from the description what dimension of the box is width, and which is length, because I have no clear understanding what would be a length of a 2D rectangular shape. The description and submission tests seem to use height and not length.

    Maybe the fact that most languages uses a row-major definition of a 2D array, and the fact that the outer array of rows has some length, is enough. Although I am not sure if this works for 2D arrays in C#, because there is no outer array which would have a length.

    I am not a native English speaker, so I have no good proposal how to clear things up. I will be fine if you just declare this a user problem and dismiss the suggestion. I just wanted to let you know that the length thing actually confused me to the point of checking sample tests, because I could not figure out the requirement just by reading the description. width and height would be clearer to me because that's how I am used to think about matrices and other kinds of "rectangular sets of numbers", like images etc.

  • Default User Avatar

    Can you give an example of a test case that comes up false?

  • Default User Avatar

    The naming of the arguments was discussed when the kata was first approved, and I have tried to be consistent in the translations since then. @hobovsky, are you suggesting that only the C# version should be changed, or does your suggestion apply to other languages as well?

  • Custom User Avatar

    I find the naming of arguments in C# utterly confusing. The name length does not seem, at least to me, to be a good complement of width. The "length" and "width" seem to overlap in meaning, and I am not sure if "length" applies to rectangular matrices at all. I would suggest renaming length to width. With current setup, it's difficult to tell what argument relates to what dimension of the output matrix.

  • Custom User Avatar

    But why is this a kata issue? Did you find a bug in the kata? What bug is this?

  • Default User Avatar

    No problem, but just to make sure that I'm understanding correctly: random is only used inside GenerateRandomChessboard(). Would you prefer new Random() being done before the for loop in ThreeHundredRandomTests(), and then random being passed as a parameter to RunOneTest() and from there to GenerateRandomChessboard()?

  • Default User Avatar

    It looks good, just one small nitpick: it looks like you are seeding the RNG at every loop iteration, which is usually considered bad practice. Can you move the new Random() out of the loop ?

  • Default User Avatar

    My apologies for the mistaken sample test in the Java translation! As penance :-), here is a C# translation, with the offending position fixed and restored.

    C* translation

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    Trying to learn binary tree,
    tried to work the kata making a Node class and so one,
    couldn't doit, infact couldn't construct the tree!! :(
    but anyway did it in a simple way.....,
    am i being stupid to doit in this way??

  • Default User Avatar

    I added a reference to that kata in the description - thanks!

  • Custom User Avatar

    Another duplicate by myjinxin: https://www.codewars.com/kata/5848f4f2d8543bf3c7000602

    The proposed kata is somewhere between raulbc's and myjinxin's katas in terms of difficulty. It has a performance requirement similar to myjinxin's kata, but like raulbc's kata only requires returning the length of the sorted array (which simplifies things).

  • Loading more items...