Refactor playRobots function