-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
69 lines (54 loc) · 1.69 KB
/
main.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 system import System
x = System()
print('Rock, Paper, Scissors'+' '+'Author: Mahtab')
computer_point = 0
user_point = 0
opt = True
willplay = True
name = None
while willplay:
if opt:
print("Enter 'r' for rock, 'p' for paper, 's' for scissors\nRock Wins With Scissors\nPaper Wins With Rock\nScissors Wins With Paper")
print()
if not name:
name = input('Enter Your Name Here: ')
p = 'a'
while p.isalpha():
p = input('Enter The Winning Point Here: ')
print('Match Has Started..')
print()
user = '0'
p = int(p)
computer_point = 0
user_point = 0
user = 1
while computer_point != p or user_point != p:
user = 1
while user != 'r' and user != 'p' and user != 's':
user = input("Enter 'r', 'p' or 's': ")
if user != 'r' and user != 'p' and user != 's':
print('Invalid!')
print()
bot = x.bot()
print()
print(f'{name} = {user} Computer = {bot}')
print()
if x.sys_gameOver(user, bot) == 1:
user_point += 1
elif x.sys_gameOver(user,bot) == 2:
computer_point += 1
print(f"{name}'s point: {user_point} Computer's Point: {computer_point} Winning Point: {p}")
print()
if computer_point == p or user_point == p:
break
print(f"{'You Have Won' if user_point==p else 'Computer Has Won'}")
print('You Have 3 Options:\n1)Play Again\n2)See The Introduction\n3)Exit')
m = input('Enter Your Choices Here: ')
if m == '1':
willplay = True
opt = False
elif m == '2':
willplay = True
opt = True
else:
break