Python中的剪刀石头布游戏

时间:2018-09-13 16:45:55

标签: python

这是我的代码。当用户输入“剪刀”,计算机选择“ Rock”,输入纸张,“计算机”选择“剪刀”时,我无法获得所需的输出。请帮助它在突然停止显示适当的输出之前工作。

import random

startMessage = input("Before we start, this a game with completely random steps from the computers side. Like all games this too is useless and has a motive to bring a smile on your face. To begin playing press ENTER:  ")

print()
print()

compBrain = ["Rock", "Paper", "Scissor"]

userReplyOne = random.choice(compBrain)

userInput = input("Rock, Paper or Scissor?  : ")
print()
print()
print("The Computer Chose", userReplyOne)

if userInput == userReplyOne:
  print("Aww man, Its a tie!!")
elif userInput == "Rock":
  if userReplyOne == "Scissor":
    print("WHEEE YOU WINN!! UR MOMMA WILL BE PROUD!")
elif userInput == "Rock":
  if userReplyOne == "Paper":
    print("LMAO U LOSE!! BOOO")
elif userInput == "Paper":
  if userReplyOne == "Rock":
    print("WHEEE YOU WINN! UR MOMMA WILL BE PROUD!")
elif userInput == "Paper":
  if userReplyOne == "Scissor":
    print("LMAO U LOSE!! BOOO")
elif userInput == "Scissor":
  if userReplyOne  == "Paper":
    print("WHEEE YOU WIN !! UR MOMMA WILL BE PROUD!")
elif userInput == "Scissor":
  if userReplyOne == "Rock":
    print("LMAO U LOSE!! BOOO!")

0 个答案:

没有答案