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.
My solution was failing a few tests when hitting "Attempt" so I tried yours. However, I do not understand what is happening here:
Notice the last step: On the high left corner the cell is dead, in order to turn from dead to alive it needs to have exactly 3 live neighbours. It only has 1. Why is it alive on the next test?
░░░░░░░░░░
░░▓▓░░░░░░
░░░░▓▓▓▓░░
░░▓▓▓▓░░░░
░░░░░░░░░░
░░▓▓░░
░░░░▓▓
▓▓▓▓▓▓
░░░░░░░░░░
░░░░▓▓░░░░
░░░░░░▓▓░░
░░▓▓▓▓▓▓░░
░░░░░░░░░░
▓▓░░▓▓
░░▓▓▓▓
░░▓▓░░
Edit: Okay this ruined the visutalization. But basically on the glider 2 test, you pass a dead cell to alive without 3 neighbours and it passes the test I was failing. Am I missing something regarding the rules?
Copy that! thanks :)
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
You can change
if (c == 1)
forif(c)
. It will look more pro :DI really like this solution as it shows me just how flexible and concise the array methods can can be.
This solution returns
undefined
for negative values ofn
. Notnull
as stated in the description.