winner = (3 + player1 - player2) % 3; # Rock=0, Paper=1, Scissors=2 # 1 if player1 wins, 2 if player2 wins, 0 if draw