number = 1
p1 = 0
p2 = 0
while number <5:
gametype = input("Do You Want To Play 1 Player Or 2 Player")
if gametype == "2":
player1areyouready = input("Player 1, Are You Ready? (Yes Or No)") #Asking If Their Ready
if player1areyouready == "yes": #If Answer is Yes
print ("Great!")
else: #If Answer Is Anything Else
print ("Ok, Ready When You Are! :)")
player2areyouready = input("Player 2, Are You Ready? (Yes Or No)") #Asking If Their Ready
if player2areyouready == "yes":
print ("Great, Your Both Ready!") #If Both Are Ready
else:
print ("Ok, Ready When You Are! :)")
print ("Lets Get Right Into Round 1!") #Start Of Round 1
game1 = input("Player 1, What Is Your Decision? (Rock, Paper or Scissors?) (No Capitals Please)") #Asking Player 1 For their Decision
game2 = input("Player 2, What Is Your Decision? (Rock, Paper or Scissors?) (No Capitals Please)") #Asking Player 2 For Their Decision
if game1 == game2:
print("Tie!")
p1 + 0
p2 + 0
print ("Player 1's Score Currently Is...")
print (p1)
print ("Player 2's Score Currently Is...")
print (p2) #I'm Programming A Rock, Paper Scissors Game
在這個岩石紙剪刀遊戲中,我找到了與我的分數變量麻煩。由於某種原因我編程的方式我的代碼意味着我的分數不會加起來。請幫助:) 提前致謝基本變量不添加!!! (我的代碼的一個部分)
您需要執行'p1 + = some_score'來切換'p1'。你不能只是'p1 + some_score',因爲它不會保存結果。 –