Example #1
0
def test_fifo() -> None:
    ic = Intcomputer([3, 9, 3, 10, 4, 9, 4, 10, 99, 0, 0])
    ic.input(1)
    ic.input(2)
    ic.run()
    assert ic.output() == 1
    assert ic.output() == 2
Example #2
0
def test_in() -> None:
    ic = Intcomputer([3, 1, 99])
    ic.input(1)
    ic.run()
    assert ic.ram[1] == 1