Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 30 additions & 8 deletions src/kata1/rps.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,39 @@
#'Ganaste!'
#'Perdiste!'
def quienGana(player, ai):
return ""
resultado = 'Perdiste!'
piedra = '0'
papel = '1'
tijeras = '2'
player = str(player)
ai = str(ai)
print("AI1: " + str(ai))
print("player: " + str(player))
if player == piedra:
if ai == piedra:
resultado = 'Empate!'
elif ai == tijeras:
resultado = 'Ganaste!'
elif player == papel:
if ai == papel:
resultado = 'Empate!'
elif ai == piedra:
resultado = 'Ganaste!'
else:
if ai == tijeras:
resultado = 'Empate!'
elif ai == piedra:
resultado = 'Ganaste!'
return resultado

# Entry Point
def Game():
#
#

#
#

#programar
player = input("Escribe una opcion [0.Piedra - 1.Papel - 2.Tijera]: ")
ai = randint(0,2)
print("AI :"+ str(ai))
winner = quienGana(player, ai)

print(winner)

Game()