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.
out
is a local array variable. withreturn out;
you are returning the address of a local variable, which is incorrect. as soon as the function exits the address becomes invalid.out
is missing1
byte for the nul-terminatorthe C translation does not describe how the returned pointer should be allocated.
fixed there
(author is gone)
escalated here as an issue
duplicate of this suggestion
Somebody below mentioned that this kata has to be 6 kyu.. I don't think so... (I have not solved it yet...)
Enabled in this fork
Duplicate of this
You misunderstood the behaviour of wrapping (which is, arguably, not described precisely). It is not that when going from positive to negative you always end up with 255. You need to wrap through 255 to lower values, if necessary, so -1 becomes 255, -2 becomes 254, and -12 becomes 244.
L Q Q c U B N
0 -> 2 -> 4 -> 16 -> (copy = 16) -> 4 -> -12 (=255) -> output 255
expected:<2[44]> but was:<2[55]>
Where did I make a mistake?
Haskell translation
I've made an attempt at generating random valid inputs. Loops aren't generated due to the complexity of ensuring that they don't loop forever. However, they should serve the purpose of weeding out any hard-coded solutions.
python new test framework + random tests are required. updated in this fork
Quite funny kata.
Added in latest fork
python new test framework is required. updated in this fork
Loading more items...