Advertisement
Guest User

Untitled

a guest
Apr 20th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.39 KB | None | 0 0
  1. import random
  2.  
  3. print("Vamos a jugar: 'Piedra', 'Papel', 'Tijeras'.")
  4.  
  5. RondasPer = 0
  6. RondasPC = 0
  7.  
  8.  
  9. for repeticiones in range(5):
  10. Puntuaciones = 0
  11. Jug = 0
  12. Maq = 0
  13. repeticiones = 3
  14.  
  15. for repeticiones in range(3):
  16.  
  17. jugador1 = input("Eliga una jugada: ")
  18. pc = random.choice(["Piedra", "Papel", "Tijeras"])
  19.  
  20. if jugador1 == "Piedra" and pc == "Piedra":
  21. print("PC eligio Piedra: Empate")
  22. Puntuaciones = 0
  23. Rondas = 0
  24.  
  25. if jugador1 == "Piedra" and pc == "Papel":
  26. print("PC eligio Papel: Gana PC")
  27. Puntuaciones = 2
  28. Rondas = 2
  29.  
  30. elif jugador1 == "Piedra" and pc == "Tijeras":
  31. print("PC eligio Tijeras: Tu ganas")
  32. Puntuaciones = 1
  33. Rondas = 2
  34.  
  35. if jugador1 == "Papel" and pc == "Piedra":
  36. print("PC eligio Piedra: Tu ganas")
  37. Puntuaciones = 1
  38. Rondas = 1
  39.  
  40. elif jugador1 == "Papel" and pc == "Papel":
  41. print("PC eligio Papel: Empate")
  42. Puntuaciones = 0
  43. Rondas = 0
  44.  
  45. elif jugador1 == "Papel" and pc == "Tijeras":
  46. print("PC eligio Tijeras: Gana PC")
  47. Puntuaciones = 2
  48. Rondas = 2
  49.  
  50. if jugador1 == "Tijeras" and pc == "Piedra":
  51. print("PC eligio Piedras: Gana PC")
  52. Puntuaciones = 2
  53. Rondas = 2
  54.  
  55. elif jugador1 == "Tijeras" and pc == "Papel":
  56. print("PC eligio Papel:Tu ganas")
  57. Puntuaciones = 1
  58. Rondas = 1
  59.  
  60. elif jugador1 == "Tijeras" and pc == "Tijeras":
  61. print("PC eligio Tijeras: Empate")
  62. Puntuaciones = 0
  63. Rondas = 0
  64.  
  65. print ("Puntuaciones: Ordenador",Maq, "Jugador",Jug)
  66.  
  67.  
  68. if Puntuaciones == 0:
  69. Jug += 0
  70. elif Puntuaciones == 0:
  71. Maq += 0
  72. if Puntuaciones == 1:
  73. Jug += 1
  74. elif Puntuaciones == 2:
  75. Maq += 1
  76.  
  77. print ("Puntuaciones: PC",Maq, "Jugador",Jug)
  78.  
  79. if Maq > Jug:
  80. print("¡¡PC Gana la Ronda!!")
  81.  
  82. elif Jug > Maq:
  83. print("¡¡Haz ganado la Ronda!!")
  84.  
  85. if Jug == Maq:
  86. print("Ronda empatada")
  87.  
  88. if Rondas == 0:
  89. RondasPer += 0
  90. elif Rondas == 0:
  91. RondasPC += 0
  92. if Rondas == 1:
  93. RondasPer += 1
  94. elif Rondas == 2:
  95. RondasPC +=1
  96.  
  97. if RondasPer == RondasPC:
  98. print("El Juegon termina en empate")
  99.  
  100. elif RondasPer > RondasPC:
  101. print("Haz ganado el juego")
  102.  
  103. if RondasPC > RondasPer:
  104. print("Haz perdido, PC gana el juego")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement