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.
C tests have test harness warning:
fixture.c:11:52: warning: implicitly declaring library function 'sqrt' with type 'double (double)' [-Wimplicit-function-declaration]
cr_assert_eq(IsCollision(-5, 5, 5.0001, 5, -5, 5*sqrt(5)), true, "Expected true.");
^
fixture.c:11:52: note: include the header <math.h> or explicitly provide a declaration for 'sqrt'
1 warning generated.
looks good!
fixed, thanks!
Something seems off with the C random tests. For example:
< Incorrect Result >
code[13] = {
" uhefkcy mrpdrk uflndjh em zzksswz acry",
"x ogyypkkuvxpxfkajctamdsac uxqk lrsbp f",
"z zwiousp vaozd tygmv wazgstvzx rpbsdnk",
"lixlwoo mam oa ggrzui gtk k rnjcjrjy",
"xvyb gbmlhwcaerzpart dfrjhmlrvinh pvfjz",
"iqvljsba vrsv xl xw njhuq bdllcuuwxwnyw",
"ns ffmvpake q kwnezyhakbq qwxfjplh qvc",
"qfzpnf qabvstbmc bcexzj ucuolr fkov",
"dphohc dqafvqwdpdpowlbd siowt kodkcemb ",
" vepl st hkdi zt gi asvdvq rgvmjjpcuh",
"xmhapp bamj muvhnko uu ywb ynvntvnhdu ",
"eus uwg wmjkz xruttzjgmwy dyjwx ihzvdxa",
"ticc ysrrdcpmhbbzhxpjm uu oqjhikkdkhoa"
}
Submitted: "mmnikmikghmlkkiklklpkiiimjeooolknlikiok"
Expected: "i igh
iiie
i "
Why are you copying the number?
How is calling into the possibly non-trivial function pow() instead of simply writing "diff * diff" a "best practice"?
This approach has zero global ctors (which are a runtime hit).
Ugh. O(n^2) is not a "best practice IMHO.
lol idk man I was 16,
abs
should work hereI have made a Kata based on the Kumite that I started. If you want to go check it out, here's the link: https://www.codewars.com/kata/66ca80460f2a3f128a865cc5/c
No one is working together on some ultimate programming project in this thread. This is Codewars. Just have fun and do stupid shit. Nobody said this code was an improvement; it's just another submission.
How is making the code unreadable an improvement? Most code is meant to be read by others, and good C formatting is a virtue.
No need to use slow floating point math! :)
This comment is hidden because it contains spoiler information about the solution
I feel your pain. But it kinda does -- the Description says that it uses x for rows and y for columns. It's messed up, but it is specified.
Loading more items...