Beispiel #1
0
def test_step():
    """ Test """
    states = read_tests("day24_tests.txt")
    bugs = _parse_bugs(states[0])
    for lines in states[1:]:
        expected_bugs = _parse_bugs(lines)
        bugs = _step(bugs)
        assert bugs == expected_bugs
Beispiel #2
0
def test_step_recursive():
    """ Test """
    lines = read_tests("day24_tests.txt")[0]
    bugs = _parse_bugs_recursive(lines)
    for _ in range(10):
        bugs = _step_recursive(bugs)
        print(len(bugs))

    _print_recursive(bugs)

    assert len(bugs) == 99
Beispiel #3
0
def tests():
    """ Test fixture """
    return read_tests("day14_tests.txt")
Beispiel #4
0
def tests():
    """ Fixture """
    return read_tests("day22_tests.txt")
Beispiel #5
0
def test_first_repeat():
    """ Test """
    lines = read_tests("day24_tests.txt")[0]
    assert find_first_repeat(lines) == 2129920