def test_interpret_parameter_relative(self): inputs = [('3,2,0', 0, 0, ['5'], []), ('203,2,0', 0, 0, ['5'], [])] outputs = [(['3', '2', '5'], 2, 0, [], []), (['203', '2', '5'], 2, 0, [], [])] for j, i in enumerate(inputs): next_state = evolve_state(i) for k, f in enumerate(next_state): self.assertEqual(f, outputs[j][k])
def test_inputs_outputs(self): inputs = [('3,2,0', 0, ['5'], []), ('4,2,5', 0, [], []), ('104,2,5', 0, [], [])] outputs = [(['3', '2', '5'], 2, [], []), (['4', '2', '5'], 2, [], ['5']), (['104', '2', '5'], 2, [], ['2'])] for j, i in enumerate(inputs): next_state = evolve_state(i) for k, f in enumerate(next_state): self.assertEqual(f, outputs[j][k])
def test_evolve_state(self): inputs = [ '10001,0,0,0,99', '02,3,0,3,99', '10002,4,4,5,99,0', '1101,100,-1,4,0', '1002,4,3,4,33' ] outputs = [ '20002,0,0,0,99', '02,3,0,6,99', '10002,4,4,5,99,9801', '1101,100,-1,4,99', '1002,4,3,4,99' ] for j, i in enumerate(inputs): next_state = evolve_state((i.split(','), 0, [], [])) self.assertEqual(','.join([str(i) for i in next_state[0]]), outputs[j])
def test_evolve_state(self): inputs = ['1,0,0,0,99', '2,3,0,3,99', '2,4,4,5,99,0'] outputs = ['2,0,0,0,99', '2,3,0,6,99', '2,4,4,5,99,9801'] for j,i in enumerate(inputs): self.assertEqual(','.join([str(i) for i in evolve_state(i)]), outputs[j])