Ad
  • Default User Avatar

    Hi all, I believe I found a some sort of a pattern in these random tests.

    For example:

    Random tests Testing for [1, 1] and 2 It should work for random inputs too: [1, 1, 0, 0, 1, 1] should equal [1, 1, 0, 0, 1, 0, 0, 0, 1, 1]

    The correct result is my result because it has correct number (6) of elements (each iteration causes creation of 2 new elements; there are 2 elements initially and then 2 iterations). Of course, one can check the correctness even by hand on a piece of paper.
    The test answer is the list of 10 elements. Funny thing is, that the result suggested by the test is exactly the result of:

    rule30([1, 1, 0, 0, 1, 1], 2)

    So the testing routine seems to take the correct result as the first argument of tested function. I ran my function several times and it always was stopped by the very first random test.