Ad
  • 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 :)

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

  • Default User Avatar

    You are so funny. Your initial message :

    C function has char* argument, whereas it's a const char*.

    clearly reveals that you mistakenly thought (hoped ?) that I had forgotten the const qualifier and was passing .rodata strings in parameter. Then you realized your error and tried to make another vague claim, about the "API". For some reason unknown to me, you seem to hold a grudge against me and are filing dishonest issues about my translations to annoy me. Oh well, have fun.

  • Custom User Avatar

    Same answer: read the documentation or do whatever, that's called debugging, it's normal and nobody should do it for you.

  • Custom User Avatar

    Having the same "expected NaN to equal Value" with different test cases, same test cases return right results locally. (JavaScript)

  • Custom User Avatar

    If that's the intention, then please add that explicitly to either the description or the initial code for clarification.

  • Loading more items...