Implement the rock-paper-scissors logic.