Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- state_of_game = 1
- def enemyChoice():
- enemy_choice = random.randint(1, 3)
- if enemy_choice == 1:
- enemy_choice = "scissors"
- if enemy_choice == 2:
- enemy_choice = "rock"
- if enemy_choice == 3:
- enemy_choice = "paper"
- return enemy_choice
- human_choice = input("rock paper or scissors:")
- computer_choice = enemyChoice()
- print("Your Choice:" + human_choice + " V.S. Computer Choice:" + computer_choice)
- Cwin = "Computer Wins!"
- Hwin = "Human Wins!"
- T = "Tie!"
- if human_choice and computer_choice:
- if human_choice == "scissors" and computer_choice == "rock":
- print(Cwin)
- if human_choice == "scissors" and computer_choice == "paper":
- print(Hwin)
- if human_choice == "scissors" and computer_choice == "scissors":
- print(T)
- if human_choice == "paper" and computer_choice == "paper":
- print(T)
- if human_choice == "paper" and computer_choice == "rock":
- print(Hwin)
- if human_choice == "paper" and computer_choice == "scissors":
- print(Cwin)
- if human_choice == "rock" and computer_choice == "rock":
- print(T)
- if human_choice == "rock" and computer_choice == "paper":
- print(Cwin)
- if human_choice == "rock" and computer_choice == "scissors":
- print(Hwin)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement