Ken Schaefer
9 months ago
2 changed files with 47 additions and 1 deletions
@ -0,0 +1,47 @@ |
|||||||
|
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") |
Loading…
Reference in new issue