def test_example_3(self): """Test Amplifiers Example Three""" # 1. Create the amplifiers myamps = amp.Amps(num=5, inp=0, text=PROG3) # 2. Find the best self.assertEqual(myamps.find_best(), BEST3)
def test_feedback_2(self): """Test Amplifiers Feedback Example Two""" # 1. Create the amplifiers myamps = amp.Amps(num=5, inp=0, text=FB_PROG2, feedback=True) # 2. Find the best (with feedback) self.assertEqual(myamps.find_best(), FB_BEST2)
def part_two(args, input_lines): "Process part two of the puzzle" # 1. Create the Amplifiers amps = amp.Amps(num=5, text=input_lines[0], feedback=True) # 2. Get the maximum of the amplifiers using feedback solution = amps.find_best(watch=args.verbose) if solution is not None: print("Best output = %d" % (solution)) else: print("Unable to determine best output") # 3. Return result return solution is not None