📜  石头剪刀布算法 - 任何代码示例

📅  最后修改于: 2022-03-11 14:58:19.082000             🧑  作者: Mango

代码示例1
Rock: 0
Paper: 1
Scissors: 2

if ((playerTwoInput + 1) % 3 == playerOneInput)
    return "Player 1 won";
else if ((playerOneInput + 1) % 3 == playerTwoInput)
    return "Player 2 won";
else
    return "Draw";