-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRPS.py
More file actions
156 lines (143 loc) · 6.23 KB
/
RPS.py
File metadata and controls
156 lines (143 loc) · 6.23 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
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
print("Made by Aryan")
print("Rock, Paper, Scissors : version--1.0")
lives = 5
score = 0
draw = 0
computer_lives = 7
while True:
print("To begin, Enter Following Details")
username = input("please enter username")
password = input("please enter password")
if username=="admin" and password =="admin":
print("You can Play")
print("Live rules")
print("You will start with",lives,"lives")
print("If you win, you will get a extra life")
print("If you loose, your one life will be deducted")
print("If drawn, Lives stays same")
print("-----------------------------")
print("DON'T USE CAPITALS")
print("-----------------------------")
print("To see Rules, Type rules")
print("-----------------------------")
print("Want to see Score, Type - display score")
print("Want to see Draw, Type - display draw")
print("At any point, if you wanna leave, Type exit")
print("-----------------------------")
print("the computer has lives as well")
print("Can you beat the Computer....Let's See")
print("Good Luck...!!")
while True:
rps = input('Rock, Paper, Scissors?')
import random
computer = ('rock', 'paper', 'scissors')
computer = random.choice(computer)
#ROCK
if rps=="rock" and computer =="paper":
print("The Computer Choose",computer)
print("")
print("Loose")
print("")
print("")
lives-=1
if rps=="rock" and computer =="scissors":
print("The Computer Choose",computer)
print("")
print("Win")
print("")
print("")
computer_lives-=1
score+=1
#PAPER
if rps=="paper" and computer =="rock":
print("The Computer Choose",computer)
print("")
print("Win")
print("")
print("")
computer_lives-=1
score=+1
if rps=="paper" and computer =="scissors":
print("The Computer Choose",computer)
print("")
print("Loose")
print("")
print("")
lives-=1
#ROCK
if rps=="scissors" and computer =="paper":
print("The Computer Choose",computer)
print("")
print("Win")
print("")
print("")
computer_lives-=1
score=+1
if rps=="scissors" and computer =="rock":
print("The Computer Choose",computer)
print("")
print("Loose")
print("")
print("")
lives-=1
#DRAW
if rps=="rock" and computer =="rock":
print("The Computer Choose",computer)
print("")
print("Drawn")
print("")
print("")
draw+=1
if rps=="paper" and computer =="paper":
print("The Computer Choose",computer)
print("")
print("Drawn")
print("")
print("")
draw+=1
if rps=="scissors" and computer =="scissors":
print("The Computer Choose",computer)
print("")
print("Drawn")
print("")
print("")
draw+=1
#system
if rps == "rules":
print("-----------------------------------------")
print("RULES")
print("-----------------------------------------")
print("Rock win against Scissors")
print("Rock loose against Paper")
print("Paper win against Rock")
print("Paper loose against Scissors")
print("Scissors win against Paper")
print("Scissors loose against Rock")
print("-----------------------------------------")
if rps == "display lives":
print(lives)
if rps == "display score":
print(score)
if rps == "display drawn":
print(draw)
#lives
if lives == 0 or rps=='test':
print("Thanks for Playing")
print("You got",score,"correct")
print("You drawn",draw,"times")
stop = input("Press Enter to Exit")
import time
time.sleep(900)
if computer_lives == 0:
print("Thanks for Playing")
print("Computer Lost All Lives")
print("You got",score,"correct")
print("You drawn",draw,"times")
stop = input("Press Enter to Exit")
import time
time.sleep(900)
#exit
if rps == "exit":
break
else:
print("Username/Password is incorrect")