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.
Here's the initial code for C:
This is what you need to implement. A function named
smash
that returns the result. You don't need to writemain()
or accept input usingscanf
.Here's a Python example how the platform works: https://docs.codewars.com/training/training-example
im sorry to everyone i did not reply to.
i did not check my email and use codewars for a long time.
i just got a email about ejini closing this comment.
It is not how problems with kata should be reported.
i achieved the required result on dev c++ software in c language, but when i type the the exact same code here, it always finds errors and never runs. WTHeck!
I've fixed it (hopefully as what you intended to see), a lot of kata also uses this code (likely copied from some templates), so perhaps you can raise an issue everytime you've encountered them
I apologize for not elaborating.
I very much do think this is an issue - this is a beginner kata and beginners should not be presented with a sloppy mess from which they'll be trying to learn.
JS's automatic semi-colon insertion is great, it removes the need to write something that is useless. somehow though, some people still decide to use semi-colons. which .. is fine. if they do it correctly. but this is javascript, and there are no errors, so people learn to arbitrarily sprinkle them on as if though it's needed, while also not doing it correctly. it's as if they think they have to appease the machine spirit with incense and prayers.
I don't really care about semi-colons. but when used poorly it looks very embarassing. and that's the issue. let's not teach embarassing use of semi-colon. use them correctly, or leave them out.
it's still there. my fault, didn't elaborate.
that wasn't the only problem - the comment is useless, so it is also teaching useless comments to beginners, and yes, the use strict is probably not doing anything useful either, serving only to confuse, again, beginners.
Forked and approved, thanks
Done with Elixir fork above forked and approved
@trashy_incel, you're right, the previous test was derived from NASM, so I guess it should be updated too
this kind of empty arrays:
is not allowed by the C standard, it's a GCC/Clang extension. it would have been better to pass
NULL
, which has the added benefit of making incorrect solutions crash if they attempt to access itfixed
C:
missing fixed and sample tests for empty arrays
Duplicate issue above
Added
pass
Fixed though it is not really an issue :-)
Loading more items...