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.
oh, indeed.... haha
I always overlook things the first time. haha
Oh, I just realized you're the guy who approved it. Haha. Thanks for all the help, again!
Cool! I learned more about cmov after I wrote this like a week ago.
Nice to see we got similar answers, and how I could have used cmov here!
Updated!
So basically reassigning the macro'd variables to their proper types?
This was an accident.
Alright. I think I did it. Sorry, I messed up and I think I published a c fork on accident.
Edit: okay I fixed the accidental publish, too, I think.
edit2: this might help: New NASM Translation
Sorry, I didn't see this! I will give that a shot!
I realized if I dec rbp when it's an empty string, I write to memory that's before the string, which is bad.
I could have solved this with starting the string one byte forward, since I have 4x the string length to work with, but figured it would be best to just do another check and return an empty string without modifying memory outside the string.
Assembly was the language. I just figured it out, though. Was kinda weird, tbh. I had to allocat a lot more memory for the new string. I wish the errors were more descriptive. Sorry!
I am getting these errors on the random tests. it's a crash with
Test Crashed Exit code: 0 Signal code: 6
somtimes it's
Error in ./test': free(): invalid next size (normal): 0x00000000010345e0
somtimes
corrupted size vs. prev_size: 0x00000000009dfa90
somtimes
malloc(): memory corruption: 0x000000000127ab30
and once I got
double free or corruption (!prev): 0x0000000000e0a9f0
it passes all tests otherwise. I also don't call malloc or free in my code, so I am curious if it's just the random test failing?
Thanks.
ah, yea. I didn't even notice it was changed to 999999. Thanks! fixed.
Oh, interesting. I'm guessing this is because the tester function calls the solution, and rsi is still loaded with the answer, but making it a macro changes this behaviour?
Alright! done. :) thanks again! Anything I missed?
Also, I thought the rbx thing was only a MASM convention. Good to know it's also the same in NASM. Didn't realize. lol
Thanks! This is the first time I've done a translation.
curious why I should use static? I copy pasted the (now sample test cases) from the original kata, so was just wondering.
I updated some stuff. Only thing I didn't get was the fixed test cases. Should I add the fixed ones that come with the kata to the randomized ones?
Thanks again!
Loading more items...