Ad
  • Custom User Avatar

    If you run your code against that specific test case it moves the 1 over to the right by 1 per iteration instead of by 2. Also the rule on that one is the same length as the initial, Just a hint. If you need more help you can respond to this and i'll try to help more.

  • Custom User Avatar

    My solution (python) passes all the tests except 1 basic test: [0, 0, 0, 0, 1] should equal [0, 1, 0, 0, 0]
    Anyone has an idea where i'm going wrong?

  • Custom User Avatar

    Easy solution: include such an example in sample tests.

  • Custom User Avatar

    It is not in the description that rules can be longer than states. If it's actually the case (I didn't solve this kata) it should be clearly stated since it implies that neighbourhood can include the cell which state is being computed, and/or several times some cells, which is an uncommon definition of neighbourhood.

  • Custom User Avatar

    Approved by awesomead

  • Custom User Avatar
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Well, this is odd - I just ran the algorithm the kata uses with those parameters and your answer is correct. I have no idea what's going on.

  • Custom User Avatar

    As far as I can see, my solutions fails on some random tests cases when it shouldn't (more or less 10 each time)...

    I tried to see what the result should be for some of these cases "by hand" and found back my solutions. So either I did not understand something, but managed to pass the normal tests anyway, or the random tests are wrong (but this would be surprising if some people succeeded...).

    An example :

    rules = [[1, 1, 0], [1, 1, 1], [0, 0, 0]]
    initial = [1, 1, 1, 0, 0, 1, 1, 0, 0, 0]
    generations = 10

    error message :
    [0, 1, 1, 0, 0, 0, 1, 1, 1, 0] should equal [0, 0, 1, 1, 1, 0, 0, 1, 1, 0]

    And how I find back my result (and not the one in the error message...) :
    1 1 1 0 0 1 1 0 0 0
    0 1 1 0 0 0 1 0 1 0 (1)
    0 0 1 0 1 0 0 0 0 0 (2)
    1 0 0 0 0 0 1 1 1 1 (3)
    1 0 1 1 1 0 0 1 1 1 (4)
    1 0 0 1 1 0 0 0 1 1 (5)
    1 0 0 0 1 0 1 0 0 1 (6)
    1 0 1 0 0 0 0 0 0 0 (7)
    0 0 0 0 1 1 1 1 1 0 (8)
    1 1 1 0 0 1 1 1 1 0 (9)
    0 1 1 0 0 0 1 1 1 0 (10)

    I'd be very grateful if someone could explain me what is wrong in the way I am doing this !

  • Custom User Avatar

    If you look at the description carefully, rules can be of any length equal to an odd number (1,3,5...). Your solution assumes that rules are always length 3, thus failing the tests with different rule length. Try again!

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar
  • Custom User Avatar

    One thing remains fuzzy:

    This is an array of length > 0, containing arrays with length 2n + 1 (odd numbers: 1,3,5...)

    You don't explain 'n'. Either add the series 0,1,2,.. or just say that the size of the array will always be odd.

  • Custom User Avatar

    Rewrote with hopefully more clarity; let me know if there is anything else to fix

  • Custom User Avatar

    I'll give it a once over

  • Loading more items...