-
Notifications
You must be signed in to change notification settings - Fork 0
/
replits100DaysOfPython_day17_letsCheatContinue.py
69 lines (59 loc) · 1.77 KB
/
replits100DaysOfPython_day17_letsCheatContinue.py
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
66
67
68
69
from getpass import getpass as input
print("2 Player 🪨 📄 ✂️\n")
condition = True
player1_score = 0
player2_score = 0
print("Select your move using R, P or S.\n")
while condition:
player1 = input("Player 1 > ")
player2 = input("Player 2 > ")
if player1[0].upper() == 'R':
if player2[0].upper() == 'R':
print("It's a tie!\n")
elif player2[0].upper() == 'P':
print("Player 2 wins the round!\n")
player2_score += 1
elif player2[0].upper() == 'S':
print("Player 1 wins the round!\n")
player1_score += 1
else:
print("ERROR: Invalid input!")
elif player1[0].upper() == 'P':
if player2[0].upper() == 'R':
print("Player 1 wins the round!\n")
player1_score += 1
elif player2[0].upper() == 'P':
print("It's a tie!\n")
elif player2[0].upper() == 'S':
print("Player 2 wins the round!\n")
player2_score += 1
else:
print("ERROR: Invalid input!\n")
elif player1[0].upper() == 'S':
if player2[0].upper() == 'R':
print("Player 2 wins the round!\n")
player2_score += 1
elif player2[0].upper() == 'P':
print("Player 1 wins the round!\n")
player1_score += 1
elif player2[0].upper() == 'S':
print("It's a tie!\n")
else:
print("ERROR: Invalid input!\n")
else:
print("ERROR: Invalid input!\n")
if player1_score == 3:
print("Player 1 won the game!\n")
condition = False
break
elif player2_score == 3:
print("Player 2 won the game!\n")
condition = False
break
elif (player1_score < 3 and player1_score >= 0) or (player2_score < 3 and player2_score >= 0):
continue
else:
print("ERROR! Unable to process game winner.\n")
condition = False
exit()
print("Thanks for playing!")