-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRock Paper Scissor Game.py
143 lines (127 loc) · 5.16 KB
/
Rock Paper Scissor Game.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
import random
import Play_Music_Module
lis = ["Rock", "Paper", "Scissor"]
A = random.choice(lis)
print("WELCOME TO ROCK PAPER SCISSOR GAME")
print("___________________________________")
name = input("Enter your name please: ")
print("___________________________________")
rounds = 9
user_score = 0
computer_score = 0
print(f"You Have Total {rounds +1} rounds")
print(f"Your Score is {user_score}")
print(f"Computer's Score is {computer_score}")
print("____________________________________")
while rounds <= 10:
choice = input("Please choose one of the following:\n'Rock'\n'Paper'\n'Scissor': ").title()
print("____________________________________")
if choice == 'Rock' and A == 'Rock':
print("Match Drawn")
print("No one Got the point")
print(f"Your Score is {user_score}")
print(f"Computer's Score is {computer_score}")
print(f"{rounds} rounds left")
print("____________________________________")
Play_Music_Module.draw_music()
elif choice == "Rock" and A == 'Paper':
print("You Loose")
print(f"You choose {choice} and computer chooses {A}")
print("Computer got the point")
print(f"Your Score is {user_score}")
computer_score += 1
print(f"Computer's score is {computer_score}")
print(f"{rounds} rounds left")
print("____________________________________")
Play_Music_Module.loosing_music()
elif choice == "Rock" and A == 'Scissor':
print("You Won")
print(f"You choose {choice} and computer chooses {A}")
print("You got the point")
user_score += 1
print(f"Your Score is {user_score}")
print(f"Computer's score is {computer_score}")
print(f"{rounds} rounds left")
print("____________________________________")
Play_Music_Module.win_music()
elif choice == "Paper" and A == 'Rock':
print("You Won")
print(f"You choose {choice} and computer chooses {A}")
print("You got the point")
user_score += 1
print(f"Your Score is {user_score}")
print(f"Computer's score is {computer_score}")
print(f"{rounds} rounds left")
print("____________________________________")
Play_Music_Module.win_music()
elif choice == "Paper" and A == 'Paper':
print("Match drawn")
print(f"You choose {choice} and computer chooses {A}")
print("No one got the point")
print(f"Your Score is {user_score}")
print(f"Computer's score is {computer_score}")
print(f"{rounds} rounds left")
print("____________________________________")
Play_Music_Module.draw_music()
elif choice == "Paper" and A == 'Scissor':
print("You Lost")
print(f"You choose {choice} and computer chooses {A}")
print("Computer got the point")
print(f"Your Score is {user_score}")
computer_score += 1
print(f"Computer's score is {computer_score}")
print(f"{rounds} rounds left")
print("____________________________________")
Play_Music_Module.loosing_music()
elif choice == "Scissor" and A == 'Rock':
print("You Lost")
print(f"You choose {choice} and computer chooses {A}")
print("Computer got the point")
print(f"Your Score is {user_score}")
computer_score += 1
print(f"Computer's score is {computer_score}")
print(f"{rounds} rounds left")
print("____________________________________")
Play_Music_Module.loosing_music()
elif choice == "Scissor" and A == 'Paper':
print("You Won")
print(f"You choose {choice} and computer chooses {A}")
print("You got the point")
user_score += 1
print(f"Your Score is {user_score}")
print(f"Computer's score is {computer_score}")
print(f"{rounds} rounds left")
print("____________________________________")
Play_Music_Module.win_music()
elif choice == "Scissor" and A == 'Scissor':
print("Match Drawn")
print(f"You choose {choice} and computer chooses {A}")
print("No one got the point")
print(f"Your Score is {user_score}")
print(f"Computer's score is {computer_score}")
print(f"{rounds} rounds left")
print("____________________________________")
Play_Music_Module.draw_music()
else:
print("Invalid Input. Please Try Again")
print("____________________________________")
Play_Music_Module.alert_music()
continue
if rounds == 0:
print("GAME OVER")
break
rounds = rounds - 1
# Making Match Report
print("___________MATCH RESULT_____________")
print("Total Rounds Played: 10")
print(f"{name.upper()} got {user_score} points")
print(f"Computer got {computer_score} points")
if user_score > computer_score:
print(f"CONGRATULATIONS!!!\n{name.upper()} WON")
Play_Music_Module.victory_music()
elif user_score < computer_score:
print(f"OOOPS!!!\nComputer Won\nBetter Luck Next Time")
Play_Music_Module.defeat_music()
elif user_score == computer_score:
print(f"WOOW!!!\n{name.upper()} and Computer got same points\nMATCH DRAWN")
Play_Music_Module.match_drawn_music()