-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathType 2
More file actions
65 lines (61 loc) · 2.12 KB
/
Copy pathType 2
File metadata and controls
65 lines (61 loc) · 2.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
repeat = 'yes'
while (repeat == 'yes'):
#Randomizing computer choice
import random
#points
computar_point = 0
player_point = 0
while computar_point < 3 and player_point < 3:
#player's choice
player = input("Pick one! (rock, paper, or scissors): ")
possible_actions = ["rock", "paper", "scissors"]
#computers choice
computer = random.choice(possible_actions)
print(f"\n You chose {player}, computer chose {computer}.\n")
#If -> Then -> Else
#Who wins / tie
if player == computer:
print(f"Both players selected {player}. It's a tie!")
print(f"Computar score is {computar_point}.")
print(f"Players score is {player_point}.")
#Rock
elif player == "rock":
if computer == "scissors":
print("Rock smashes scissors! You win!")
player_point += 1
print(f"Computar score is {computar_point}.")
print(f"Players score is {player_point}.")
else:
print("Paper covers rock! You lose.")
computar_point += 1
print(f"Computar score is {computar_point}.")
print(f"Players score is {player_point}.")
#Paper
elif player == "paper":
if computer == "rock":
print("Paper covers rock! You win!")
player_point += 1
print(f"Computar score is {computar_point}.")
print(f"Players score is {player_point}.")
else:
print("Scissors cuts paper! You lose.")
computar_point += 1
print(f"Computar score is {computar_point}.")
print(f"Players score is {player_point}.")
#Scissors
elif player == "scissors":
if computer == "paper":
print("Scissors cuts paper! You win!")
player_point += 1
print(f"Computar score is {computar_point}.")
print(f"Players score is {player_point}.")
else:
print("Rock smashes scissors! You lose.")
computar_point += 1
print(f"Computar score is {computar_point}.")
print(f"Players score is {player_point}.")
print('------------------')
if (computar_point > player_point):
print('You lost. Try again?')
else:
print('Congrats, you won! Want to play again!')