Exemplo n.º 1
0
def test_part1():
    with open('input.txt') as file:
        specs = file.read()
    n = 1000
    moons = MoonSet(specs)
    moons.run(n)
    assert moons.total_energy() == 12082
Exemplo n.º 2
0
def test_part2():
    with open('input.txt') as file:
        specs = file.read()
    moons = MoonSet(specs)
    repeat = moons.find_first_repeat()
    assert repeat == 295693702908636
Exemplo n.º 3
0
def test_repeat_2():
    moons = MoonSet(test_input_2)
    repeat = moons.find_first_repeat()
    assert repeat == 4_686_774_924
Exemplo n.º 4
0
def test_repeat_1(use_lcm):
    moons = MoonSet(test_input_1)
    repeat = moons.find_first_repeat(use_lcm)
    assert repeat == 2772
Exemplo n.º 5
0
def test_energy1():
    moons = MoonSet(test_input_1)
    moons.run(10)
    assert moons.total_energy() == 179
Exemplo n.º 6
0
def test_energy(input_, n, energy):
    moons = MoonSet(input_)
    moons.run(n)
    assert moons.total_energy() == energy
Exemplo n.º 7
0
def test_1(input_, n, state):
    moons = MoonSet(input_)
    moons.run(n)
    expected = MoonSet.build_from_test_data(state)
    assert moons == expected