#rock,paper,scissors
#inputs of player 1 and player 2
t = ["Rock","Paper","Scissors"]
while p !='x':
p = raw_input("Player 1, please enter Rock,Paper, or Scissors!")
if p == 'x':
break,
while pp !='y':
pp = raw_input("Player 2, please enter Rock,Paper or Scissors!")
if p == 'y':
break,
#player 1 values of choice
if p == "Rock":
p = 1
elif p == "Paper":
p = 2
elif p == "Scissors":
p = 3
else
print("You have entered a wrong hand")
#player 2 values of choice
if pp == "Rock":
pp = 1
elif pp == "Paper":
pp = 2
elif pp == "Scissors":
pp = 3
#outcomes of the Game
if p > pp
print("Player 1 Wins")
elif p < pp
print("Player 2 Wins")
elif p = pp
print("Players Draw")
我不確定我的代碼出了什麼問題。有人能解釋我做錯了什麼嗎?我有所有的值存儲和輸入。但它不會運行。試圖製作一名玩家Rock,Paper,Scissors遊戲
while方法不是必需的,因爲它們p和pp總是「x」和「y」 –
無處不在的語法和縮進錯誤! –