pythonで石ハサミゲームを実現

496 ワード

#   import       random
#                          
#                            
player = int(input("       _  -1、  -2、 -3:"))
computer = random.randint(1, 3)
print("      %d,       %d" % (player, computer))
if player == computer:
    print("  !")
elif ((player == 1 and computer == 3)
      or (player == 2 and computer == 1)
      or (player == 3 and computer == 2)):
    print("computer win! ")
else:
    print("player win! ")