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.
Nice solution, clean conventions.
Didn't know .repeat existed, I even created a function to create zeroes, learned something new today nice.
Very silly of me to forget repeat() exists, so thanks for the reminder!
This comment is hidden because it contains spoiler information about the solution
Recursion, not bad)
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
with round we dont have equal chance for all possible numbers. first and last have half others chance to appear.
A test running this function 4000 times for dice(0,3). counting appearance of each number, shows:
[17% ,34% ,33% ,16%]
This comment is hidden because it contains spoiler information about the solution
I'm not agree. Considering number of coders who passed the tests successfully (as you did too) I don't think "bad luck" occurs too frequently. Right now I've just test my solution a dozen of times and none failed.
But no matter, as kata is still in beta, i've modified it to 500 dice rolls.
;)
100 dice rolls are not enough most of the times. Even if the solution is right "bad luck" can make it wrong. Refine the tests to avoid such cases.
Loading more items...