forked from fenyx-it-academy/Class4-PythonModule-Week1
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRock_Paper_Scissors_Malik_ver2.py
More file actions
67 lines (60 loc) · 2.88 KB
/
Rock_Paper_Scissors_Malik_ver2.py
File metadata and controls
67 lines (60 loc) · 2.88 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
66
67
"""
**Rock-Paper-Scissors**
* Oyuncularin adlarini alip tas - kagit - makas oyunu oynatiniz.
* Oyun 10 el surecektir. 10 el sonunda kazanan belli olacaktir.
* Skor sonucta gosterilecektir.
"""
while True:
print("******************************************************\n"
"*** Rock-Paper-Scissors ***\n"
"******************************************************")
player_1 = input('1st Player Name: ')
player_1_points = 0
player_2 = input('2st Player Name: ')
player_2_points = 0
tour = 5
winner = ""
print("******************************************************\n"
"*** Please Make your choice in order. ***\n"
"******************************************************\n"
"* Rock = [1] *\n"
"* Paper = [2] *\n"
"* Scissors = [3] *\n"
"******************************************************")
for i in range(1, tour+1):
player_1_choice = input('1st Player Choice: ')
player_2_choice = input('2nd Player Choice: ')
if (player_1_choice == "1" and player_2_choice == "1") or\
(player_1_choice == "2" and player_2_choice == "2") or\
(player_1_choice == "3" and player_2_choice == "3"):
print(str(i) + ".Round Rock=Rock Draw")
elif (player_1_choice == "1" and player_2_choice == "3") or\
(player_1_choice == "2" and player_2_choice == "1") or\
(player_1_choice == "3" and player_2_choice == "2"):
print(str(i) + ".Round Rock>Scissors Winner Player1")
player_1_points += 1
elif (player_1_choice == "1" and player_2_choice == "2") or\
(player_1_choice == "2" and player_2_choice == "3") or\
(player_1_choice == "3" and player_2_choice == "1"):
print(str(i) + ".Round Paper>Rock Winner Player2")
player_2_points += 1
else:
print("Incorrect input. Try again.")
i -= 1
continue
print("******************************************************\n"
"*** Game Over ***\n"
"******************************************************\n")
if player_1_points == player_2_points:
winner = "Draw"
print(f'\n{player_1}:{player_1_points}'
f'\n{player_2}:{player_2_points}'
f'\n {winner} !')
else:
if player_1_points > player_2_points:
winner = player_1
elif player_1_points < player_2_points:
winner = player_2
print(f'\n{player_1}:{player_1_points}'
f'\n{player_2}:{player_2_points}'
f'\nWINNER is {winner} !')