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.
as said by phaffywaffle above the line
jaden_case[strlen(jaden_case)] = '\0';
is wrong, because it's tautological. By definition, if a string is nul-terminated,string[strlen(string)] == '\0'
. So you werent nul-terminatingjaden_case
.Yes, I'm sure I didn't. It took me some time to understand the kata precisely because of that test case I mention (it didn't make any sense, and I thought I was missing something). I wonder if there is any kind of test log to check if someone was editing the tests and forgot to finish or something similar.
Anyway, when hitting ATTEMPT I was able to submit, so at least there's that :P
I cannot see such test case. The only one similar I see is this:
Are you sure you did not modify the sample tests?
I saw something weird and I didn't really know where to report it, hope this is okay.
In C, I noticed a test case that made no sense:
Unless I'm missing something, the expected result should not contain 'A' or '?'.
Also, every other test was commented, so I came to raise an issue. However, I wanted to double check before posting, and now all the tests are okay and uncommented. Furthermore, seems like one of the tests in the "Test cases" section is missing when you try to solve the kata (the last one).
Is this normal? Was someone messing up with this kata?
Thank you both, I got stuck at the time and now when I came back to check your comments, I didn't even understand my approach.
It's been a month since I asked for help and now that I'm more used to this, I've been able to easily solve it, but I appreciate the help!
Unfortunately, SIGSEGV comes from sample tests, because they have a copy/paste error. Full tests seem to not have the error and they work. You can temporarily fix the error by replacing first assertion (lines 50-55) with:
But stll, the SIGSEGV gets triggered only when your solution is incorrect, and it indeed has a mistake. It does not handle the
sz_out
correctly.getting a
SIGSEGV
is tough because AFAIK you can't tell what caused it until you stop doing it, so examine all places in your code where you attempt to access memory, then consider the possibilities of how that could go wrongThis comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
The error message means that the tests expected this string to be the output from your function:
'I Should Just Stop Tweeting, The Human Conciousness Must Raise Before I Speak My Juvenile Philosophy.'
But instead your function returned this string:
'How Can Mirrors Be Real If Our Eyes Aren't Real' to equal '
Think about how your function could work with any string, rather than just the one you've pasted into your code. If you're still unsure, try to define a simpler function on
String.prototype
and call it on any string to see how it works.You must read the log like this:
expected "Your answer" to equal "The correct answer"
. Have a look there to debug your code: https://docs.codewars.com/training/troubleshootingwhat is this? expected 'How Can Mirrors Be Real If Our Eyes Aren't Real' to equal 'I Should Just Stop Tweeting, The Human Conciousness Must Raise Before I Speak My Juvenile Philosophy.'
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Loading more items...