-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path07 RockPaperScissors.py
More file actions
52 lines (44 loc) · 1.51 KB
/
Copy path07 RockPaperScissors.py
File metadata and controls
52 lines (44 loc) · 1.51 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
# Rock Paper Scissors
gameOver = False
while not gameOver:
print("\n\nRock, Paper, Scissors!")
print("Player One!")
while True:
playerA = input("What hand you gonna play? ").lower().strip()
if playerA in ['rock', 'paper', 'scissors']:
break
else:
print("Rock, paper, scissors only.")
print("\n\nRock, Paper, Scissors!")
print("Player Two!")
while True:
playerB = input("What hand you gonna play? ").lower().strip()
if playerB in ['rock', 'paper', 'scissors']:
break
else:
print("Rock, paper, scissors only.")
if playerA == playerB:
print("\n\nIt's a DRAW!!")
else:
if playerA == 'rock':
if playerB == 'scissors':
print("\n\nPLAYER ONE WINS!!")
elif playerB == 'paper':
print("\n\nPLAYER TWO WINS!!")
elif playerA == 'scissors':
if playerB == 'paper':
print("\n\nPLAYER ONE WINS!!")
elif playerB == 'rock':
print("\n\nPLAYER TWO WINS!!")
elif playerA == 'paper':
if playerB == 'rock':
print("\n\nPLAYER ONE WINS!!")
elif playerB == 'scissors':
print("\n\nPLAYER TWO WINS!!")
reset = input("\n\nNew game? (y/n): ")
if reset[0] == 'y':
gameOver = False
else:
gameOver = True
else:
print("\n\nGAME OVER!")