Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Very funny kata, well done, congratulations.
It's more of his teacher's fault, thinking he would just do 500 boring equations ;)
LOL, cheer up, revelation is near when you start scratching your head :)
maybe i'm just bad at programming, but i think Jack would be better off just doing his homework.
Thanks!
I found a mistake. Sometimes there are more than 1 space.
The log means your code returns NaN, but should return -158.
There are much more random tests than fixed tests.
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.
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.
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.
How would this be somewhat pointful? Could you give an example to justifiy there is actually an issue here?
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.
You are so funny. Your initial message :
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.Same answer: read the documentation or do whatever, that's called debugging, it's normal and nobody should do it for you.
Having the same "expected NaN to equal Value" with different test cases, same test cases return right results locally. (JavaScript)
If that's the intention, then please add that explicitly to either the description or the initial code for clarification.
Loading more items...