Advertisement
Guest User

Untitled

a guest
Nov 27th, 2013
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. #Dodo
  2. #Nov 27, 2013
  3. #rps.py
  4. def rps():
  5. countp1=0 #initial score
  6. countp2=0 #initial score
  7. while countp1 < 2 or countp2 < 2: #run until best out of 3
  8.  
  9. #enter player moves
  10. player1=raw_input("Player 1's Move:")
  11. player2=raw_input("Player 2's Move:")
  12.  
  13. if player1 == "rock" and player2 =="rock":
  14. print "It's a Tie!"
  15. elif player1 =="rock" and player2=="scissors":
  16. print "Player 1 wins!"
  17. countp1=countp1+1 #add point to player 1
  18. elif player1=="rock" and player2=="paper":
  19. print "Player 2 wins!"
  20. countp2=countp2+1 #add point to player 2
  21. elif player1 == "paper" and player2 =="paper":
  22. print "It's a Tie!"
  23. elif player1 == "paper" and player2=="scissors":
  24. print "Player 2 wins!"
  25. countp2=countp2+1
  26. elif player1 == "paper" and player2=="rock":
  27. print "Player 1 wins!"
  28. countp1=countp1+1
  29. elif player1 == "scissors" and player2=="scissors":
  30. print "It's a Tie!"
  31. elif player1 == "scissors" and player2=="paper":
  32. print "Plyaer 1 wins!"
  33. countp1=countp1+1
  34. elif player1 == "scissors" and player2=="rock":
  35. print "Player 2 wins!"
  36. countp2=countp2+1
  37. else:
  38. print "Invalid input. You must choose rock, paper, or scissors"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement