Moved solving puzzles into a separate function

The function beat_opponent function continues to solve sets of puzzles
until our favor is more than the opponents.