Ad
  • Custom User Avatar

    It is my code which I wrote. you can find it if you open my name

  • Custom User Avatar

    It's time to recruit clairvoyants to the Codewars team.

  • Custom User Avatar

    WHERE CODE

  • Custom User Avatar

    Can someone please look at my code, because it passes all tests except Random_tests. I test it on two other outer compiler and give correct results. But here I do not know why not?

  • Custom User Avatar

    Very funny kata, well done, congratulations.

  • Custom User Avatar

    It's more of his teacher's fault, thinking he would just do 500 boring equations ;)

  • Custom User Avatar

    LOL, cheer up, revelation is near when you start scratching your head :)

  • Custom User Avatar

    maybe i'm just bad at programming, but i think Jack would be better off just doing his homework.

  • Custom User Avatar

    Thanks!
    I found a mistake. Sometimes there are more than 1 space.

  • Custom User Avatar

    The log means your code returns NaN, but should return -158.

    There are much more random tests than fixed tests.

  • Custom User Avatar

    Why don't pass? Why expected NaN?

    Did not work with x + 143 = + 111 - 82 - 44 : expected NaN to equal -158

    If x = -158, then from left and right side would be -15.

    It pass all test except random (javascript).

    Tested again:
    Did not work with x + 97 + 134 + 8 + 105 = - 67 + 72 : expected NaN to equal -339
    The same error.

  • Custom User Avatar

    In such cases I follow the "principle of least surprise"; in a function that calculates a value based on a string, but does not need to modify that string, the string would typically be marked as const. Seeing no const marker is then surprising and leads to ambiguity with the user. In this specific case I understand that it would be beneficial for the user if he actually COULD modify the string, to not let the user need to make a copy of a string if he wants to modify it. But because of the ambiguity the user is not sure he CAN modify the string. Therefore making it in this specific case explicit the string can be modified would add clarity.

  • Custom User Avatar

    I am with nomennescio on this one. In C, for this task, I would not expect the input string to be modifiable. Seeing the input string being non-const struck me as awkward.

  • Custom User Avatar

    For a 7 Kyu kata it doesn't hurt to make things more explicit.

    How would this be somewhat pointful? Could you give an example to justifiy there is actually an issue here?

  • Custom User Avatar

    There is no grudge. I care for clear descriptions and avoid ambiguity in them. That's all. It's called constructive feedback. Especially on CW the memory model used for parameters is often impossible to guess, therefore it needs to be clearly described. For a 7 Kyu kata it doesn't hurt to make things more explicit.

  • Loading more items...