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.
Thanks for your feedback. I'm not sure I understand the concern over
using namespace std;
, but I'll spend some time on the doc you linked and do some experimentation. For now I've unpublished the translation.You are right about the floats and
Equals
. I missed that detail. It'll be corrected before I republish. I'll take a look at your earlier note regarding the error messages when I have time later. Thanks!Could you address this? Is that indeed the most practical solution?
Due to specific C++ setup on Codewars,
using namespace std;
can be safely used only in test snippets, and not in the "complete solution", "solution setup", or in "preloaded" snippet (https://docs.codewars.com/languages/cpp/authoring#using-directives).Another bug in the translation: floats should not be compared for strict equality with
Equals
. Instead,EqualsWithDelta
should be used.Approved.
This comment is hidden because it contains spoiler information about the solution
Approved.
Updated, thanks!
It appears that
os.clock()
doesn't account for time spent insleep
on Linux, but it does on Windows (Tested on both Ubuntu and Windows with Lua 5.3, 5.4 and LuaJIT). I've implemented a workaround timing function that reads/proc/uptime
, which is more accurate than usingos.time()
.approved
Looks nice!
There's so much in Python you'd have to disable to make this minimally difficult...
Approved. Thanks!
If you fix the typo in the funtcion name in the description example, I'm happy with it.
Testing frameworks generally do not foresee this usage. I think some other languages have to use bare
assert
s with custom messages. You managed nicely with what you had. :]Approved.
The comments in the random tests are really not necessary. The code is self-documenting; the comments just distract there.
Please suppress the urge to code golf your test suite.
join``
is just less readable thanjoin("")
- don't do it, write for readability and maintainability, CW can spare those couple of characters.I would have commented this directly on the translation, but CW would not let me. It also shows two comments it isn;t actually showing. Something's very wrong there.
I'm not worried about the encoding of "impossible";
-1
is as good asNone, Nothing, null
or whatever.I am worried about the failure messages of the random tests. There is ( still :[ ) enough confusion with the current failure messages; could
present
-1
and[4,13]
more clearly as actual and possible answers respectively? Using "Expected" and "Actual" with different meanings than in all other kata on CW seems like a bad idea. Yes, you may have to write custom assertions with custom messages. I would really appreciate if you stayed as close as possible to existing languages here; this point has been belaboured extensively here.Loading more items...