You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.0 KiB
47 lines
1.0 KiB
import random |
|
|
|
# Rock |
|
rock = ''' |
|
_______ |
|
---' ____) |
|
(_____) |
|
(_____) |
|
(____) |
|
---.__(___) |
|
''' |
|
|
|
# Paper |
|
paper = ''' |
|
_______ |
|
---' ____)____ |
|
______) |
|
_______) |
|
_______) |
|
---.__________) |
|
''' |
|
|
|
# Scissors |
|
scissors = ''' |
|
_______ |
|
---' ____)____ |
|
______) |
|
__________) |
|
(____) |
|
---.__(___) |
|
''' |
|
|
|
choices = [rock, paper, scissors] |
|
|
|
print("What do you choose? Type 0 for Rock, 1 for Paper or 2 for Scissors") |
|
player_choice = int(input()) |
|
print(f"You chose\n{choices[player_choice]}") |
|
|
|
computer_choice = random.randint(0, 2) |
|
print(f"The computer chose\n{choices[computer_choice]}") |
|
|
|
if (player_choice == computer_choice): |
|
print("Tie") |
|
elif (player_choice == 0 and computer_choice == 1) or (player_choice == 1 and computer_choice == 2) or (player_choice == 2 and computer_choice == 0): |
|
print("You lose") |
|
elif (player_choice == 0 and computer_choice == 2) or (player_choice == 1 and computer_choice == 0) or (player_choice == 2 and computer_choice == 1): |
|
print("You win")
|
|
|