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.
After going down the wrong track for ages I've finally got it over the line. Seemed much harder than the other 5 kyu kata.
Aha, brilliant, thanks. Now using malloc rather than static. That bamboozled me for ages. Added 'const' back into the comparator and not using 'sizeof(char)'. Great help, passing now, thanks. Coming from higher level languages to come and grapple with memory management and pointers is something I'm finding really hard!
Just FYI, you can post your code here in this thread, if you mark your post as spoiler and use markdown code formatting.
Now about your code: there's a lot going there, and there is a couple of problems with it. But the most important problem is that your solution suffers from buffer overflows. Did you try to run your solution in your local IDE, with all test cases given in sample tests? I changed your solution in two places by adding one character and it passed for me.
Other problems:
convertToText
is bad,comparator
is bad,sizeof(char)
is always superfluous and unnecessary,This comment is hidden because it contains spoiler information about the solution
Sorry, but we can't see why either :(
Maybe if we could see your code we could know why it crashes.
I see my c solution crashing the test with "Test Crashed Caught unexpected signal: SIGSEGV (11). Invalid memory access." but I'm not seeing why. Any help please?
The esolang series is really interesting and I'm delighted to have got through it. This last one, boolfuck, could have better instructions. A lot of time was spent figuring out what was meant rather than solving the problem.
Me too!
Ah yes, *lg, thanks, I'm a bit further along now. Please mark as resolved.
The questioned is answered but not resolved. Increasing packet length and so forth isn't affecting whatever the fault is afaics. The specific test case failing is reporting that my 'encode' function is not returning anything where it is passing without fault in my local environment. Without being able to get it to break locally means I can't debug it. It is expecting {"ijJ tipvme ibw", "f lopxo uibu z", "pv xpvme ibwf ", "b qfsgfdu botx", "fs gps nf!!!"} which is what I get locally.
Question answered.
Thanks - well spotted!
There may be other things, but you have an out-of-bounds access here:
(also,
char unpacked[1000];
when you have no guarantee that the length will be < 1000 is very bad)I'm at a loss as to why my C code isn't returning anything. My solution is based on the "First Variation on Caesar Cipher" which was fine. It's all sweet on my local system. What am I doing wrong?
C version: This was tough but many learning points taken. Allocating memory! Wow!
Loading more items...