Ad
  • Custom User Avatar

    Out of curiosity, does this kata encourage the use of OOP?

  • Default User Avatar

    The None input is such nonsense. Why not strings? Why not elephants? Why do I not get functions as input? How is None significant to this problem?
    False is a meaningful result. Why am I asked to give a meaningful result for input that is not meaningful? Meaningful output for meaningless input is such a javascriptism, and I somehow doubt that is a feature they like. It is not something to emulate.
    If the caller sends in two things of different shape, then that's entirely their problem. There should be no code to handle that in my function. If I was to be incredibly generous, then my code would raise an exception.
    Why isn't None included in Haskell? Is it suddenly not an important test case? It's perfectly possible to represent it, all that needs to be done is to change the type:

    Maybe [Int] -> Maybe [Int] -> Bool
    

    I see it mentioned sometimes that these mixed type things are difficult to translate to typed languages. This isn't entirely true - they're perfectly capable of modelling this in their types. The only problem is that it becomes a whole lot more clear how much nonsense it is, that a whole lot of nothing is being treated as significant. It isn't any more meaningful in dynamically typed languages.

    Providing None as input is something ALL kata can do. Does it make them better? Should every python solution for every kata start with a check for None? Does idiomatic python code tend to do this?

  • Default User Avatar

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

  • Default User Avatar

    if they are of differing lengths then they cannot be the same and if they are empty then they are the same - these aren't even special cases

  • Custom User Avatar

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

  • Custom User Avatar

    Check your conditions. I had this issue because I wasn't dealing with the inputs correctly per the prompt. Once I cleaned up my conditionals it passed without issue.

    Not sure if this is what's happening to you, but just wanted to mention since it's a similar result.

  • Default User Avatar

    Hi g964:
    thank you for your reply. I am not sure, whether you had the chance to look at the data (output from my function, which showed in the transaction log, where the squared value was different from the result, which seemed okay plenty of times. I checked the hints other ppl got for the same kata and read the respective FAQ section repeatedly. I am also aware that even though "MY CODE" is just great, I might (likely) have done a mistake as you indicated, but so far I believe there might be an issue. My original solution changed drastically after I adviced a person with similar problems as me. I thought my newly foundsolution was fool proof ... :( and I feel a lot of sympathy with your argumentation (40,000 ppl are possibly right!).

  • Default User Avatar

    Before posting issues have a look at the top of the page: here 1930 guys passed the C++ kata out of more than 40,000 and the fixed tests are the same in all language. Chances are high that there is a problem in your code.
    So it's not a kata issue. Can be a problem in your code and/or maybe you don't identify correctly the failed test. Print the input, your output and a clear sign between each test to see exactly which fails.

  • Custom User Avatar

    How would you refactor it? It says that after every bounce it would be 1/3 every time from the height it was launched at. Idk if I am lacking the actual math knowledge or if the tests are failing.

  • Custom User Avatar

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

  • Default User Avatar

    same issue. . I think I need to refactor my code :s

  • Custom User Avatar

    I used a while loop and made sure that it kept running so long as I kept changing height. However, it passes when I click the attempt but fails the Submit tests. Anyone having issues with this one?

  • Custom User Avatar

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