Ad
  • Custom User Avatar

    Seems arbitrary. Self-comparison plays a role in symmetry for odd-length arrays. You still have even-length left for your symmetry driving needs

  • Custom User Avatar

    But why arbitrarily let length 1 arrays count but not larger odd length arrays? Wouldnt it make way more sense to treat them the same?

  • Custom User Avatar

    But arr[2] == arr[5-1-2] == 3

  • Custom User Avatar

    Why does [1,2,3,4,5] have no mirror index but [42] has one?

  • Custom User Avatar

    getting

    ReferenceError: rndList3 is not defined
        at Context.<anonymous> (file:///workspace/test.js:22:18)
        at processImmediate (node:internal/timers:464:21)
    

    in the random tests of the sample tests

  • Custom User Avatar

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

  • Custom User Avatar

    In the end of the secription it says that your program is not allowed to access its own source code.
    So such things are not accessible.

  • Custom User Avatar

    Looks good, approved :)

  • Custom User Avatar

    Great to hear, thanks :)
    And Ive run the new test cases a few times and the time variance seems quite high.
    Maybe we should add some smaller grids than 8 instead, to make the time it takes more uniform.

  • Custom User Avatar

    Looks nice already, although I dont know much about js. A few things:

    • The fixed sample tests should also be in final full tests
    • Your python solution takes a few seconds longer than your js solution. I dont know if your js solution is more optimized but if not maybe add a few more tests in the bigger random section until the performance requirement is roughly the same. Maybe adding the fixed tests will do this already
  • Custom User Avatar

    Approved :)

  • Custom User Avatar

    But one sentence about how "garden of edens" exist should clear that up, although there hasnt been any garden of eden in 8x8 or smaller found yet so probably evry tests case will have a solution anyway. Also to completly avoid such patterns you would have to run a reference solution on each test case, which would lower the amount of tests. Or generate the test cases by running a pattern forward, but then you only get quite sparse patterns.

  • Custom User Avatar

    Yes the assertion feedback is something I already wanted to enhance some time ago :D

    Ok I will change it to infinite boards then. There are also some interesting cases (found by doooom below) where a (m+2)x(n+2) predecessor doesnt exist, but a (m+4)x(n+4) does exist. Those then could also be tested maybe (Although the chance is very slim that this happens during random tests).
    But I dont have too much time at the moment so could take a bit..

  • Custom User Avatar

    It seemed to me that the format of the answer is clearly described (that it should be bigger to make solutions more often possible and that the extra cells should die). But maybe I can clarify it more, or change the format to same sizes. Also my solution at least doesnt pad the input board, havent looked at all the others.

    I dont know why I chose finite worlds back then. An infinite world seems to me like the more natural setting for the task now. Then you wouldnt even have to define a certain fixed dimension for the answer, as long as it evolves into the goal somewhere and the only living cells belong to the goal pattern. Could invalidate a lot solutions, not sure, but I wouldnt be against changing the kata to infinte boards.

  • Custom User Avatar

    Its not? There just arent big enough test cases to see a difference. Try triangular 100000000 `shouldBe` 5000000050000000 for example.

  • Loading more items...