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.
done ;-)
please reject i messed up
Code is working
I've fixed the description
No test for
"" => ""
done.
Missing
return type
in initial solution setupYou should not compare user's solution with their own! Instead, you should make a reference solution and hopefully differs from the user solution
I don't know if you could get what you wanted. In case of doubt you can refer to other katas in PHP using arrays in input to see how they do it. It's something to be cautious with in many languages.
I might not have been clear, there exists one cheap solution: compute
expected
separately before calling the user function, and it's fine too.Hi. As far as I know that's not possible. I might be wrong though. To make sure the input array doesn't get changed I will create the array in a separate private function.
Hi. I don't know much PHP so I cannot tell, but please make sure the user cannot modify the input, or the tests can be cheated easily. There was this problem originally in Python and Javascript, it has just been fixed. You must pass a copy to the user, or make sure
expected
is computed before calling the user's function.Nice Translation
Should be fine.
Though, instead of
It's better to just do
I changed it afterward in the other languages, the first code will generate more zeros in colors R and G, actually there's no reason for that.
If there's something else to fix let me know.
Ok I found the solution
The easiest way is probably to generate for each string a random integer inferior to 2 ^ 24 and convert it to hex. That's why I did in Python and Js and it works like a charm.
Loading more items...