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.
this doesn't parse floats correctly. it parses "3.1" as 1.3 and "3.14" as 0.53
This comment is hidden because it contains spoiler information about the solution
absolutely this.
in fact, generating the random strings dominates execution time. I tried a fork where the random string is generated once and provides substring slices for each test but even that times out when generating a single 100,000,000 term string.
Edit: i've created a fork which can generate random testcases fast enough, but guess what? even more numpy
hi, mostly updating so compiles with nim 1.6, but fixed tests so they display on failure.
do plz reply with reason if rejecting, i'm literally only here to update nim kata to 1.6, let me know what i can do to make that process as easy for you as possible
cheers!
should leading whitespace be allowed?
c++ translation doesn't test for it.
looks great to me.
i guess i'll just need to grind out 4000 honour and come back to approve
translation published. i thought putting helper display functions in 'Preloaded' would work, but maybe it's not implemented for nim?
update to a) fix sample_tests and b) enable nim 1.6
working now since https://github.com/codewars/runner/issues/194#issuecomment-1193073551
After https://github.com/codewars/runner/issues/194#issuecomment-1193073551 this now works with Nim 1.6
However, 1.6 is still greyed out when training. It's not possible to submit a translation with no changes.
Of course, in this case i can probably fix the sample test issue and publish a fork, but in general, how can one enable new versions if no changes are necessary?
how about that?
great point re: dotest function not giving good error messages.
question: will trivial forks that only enable nim 1.6 (e.g. s/random/rand/g) not be accepted?
here's how to translate that
doTest
proc into something that shows helpful error messages.the
{.inject.}
is so that 'check' prints 'actual'==whatever rather than 'actualgensym3' or somethingand wrapping it all in a
block
is so thatactual
doesn't get injected multiple timesannoyingly strformat doesnt work inside nested templates like that, so caveat emptor.