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.
A very clever solution. This helped me understand reduce better.
This one really tested my patience. Nice kata!
Thanks, I'm glad you like the kata! I got the idea from another code challenge that simulated the spread of a virus by infecting neighboring cells. I have updated the random tests to use Test.assertEquals.
There are some problems with the Python and Ruby random tests.
@adrian.eyre I'm having some trouble understanding your logic, could you please help me understand? It looks like you are generating the board and populating it with random numbers. After generating the numbers (num1, num2, num3, num4), your code adds these numbers to the pre-existing integer already in that position. This will not always result in 4 numbers whose sum is a perfect cube.
Also, I've hardcoded in the numbers from the test case I provided above (xc=2, yc=4), and have encountered a few cases producing a board with 0 lucky sevens. The description states at least 1 lucky seven will be present in the array.
Thanks again for your help with these translations, I'm happy this kata is getting some attention. Let's get these tests figured out so we can move out of beta!
Thanks! I've been playing around with the Python translation and noticed a few inconsistencies. It looks like your code does not always insert the lucky seven correctly. Here's an example...
You could fix this by checking for a valid insertion point before inserting the lucky seven. Also, when inserting multiple lucky sevens, your code will overwrite existing lucky sevens. This will not always produce invalid test cases, but I don't believe it's the expected behaviour and should be fixed.
This comment is hidden because it contains spoiler information about the solution
You need to declare the variable i when constructing your for loop.
Excellent kata, thanks!
This comment is hidden because it contains spoiler information about the solution