-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGuessingnumber.py
More file actions
91 lines (89 loc) · 3 KB
/
Guessingnumber.py
File metadata and controls
91 lines (89 loc) · 3 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
#Guess number
import random
MAX = 20
ans = random.randint(0,MAX)
cnt = 1
ISPRIME = False
isPrime = False
FUCK = False
trys = []
extra = 0
vip = ['王佳鑫']
tips = [f"Please enter a number from 0 to {MAX}.",
"Please try again:",
"No,is too small.",
"No,is too big.",
"tellmeanswer"]
name = input("Hello player,what's your name?")
print(f"OK,dear {name},let's play a game called Guessing Number !")
while not isPrime:
num = input(f"guess a number that from 0 to {MAX}:")
if num == tips[4]:
extra += 1
ISPRIME = True
if extra >= 5:
print(f"Fucking {name},you have using it {extra} times,You fucking asshole.")
print(f"The game will become more difficult.")
print("If you escape the game,you will be a shit man.")
MAX += 10
ISPRIME = False
FUCK = True
continue
if not ISPRIME and num not in str(list(range(0,MAX+1))):
print(tips[0]+"\n")
continue
elif num == ' ' or num == '\n' or num == '':
continue
else:
if ISPRIME:
trys.append(cnt)
print("Congratulations!\n")
print(f"Well,you have tried {cnt} times to guess it.")
choice = input("Do you want to play again?\nEnter y to play,enter the other to quit:")
if choice == 'y':
ans = random.randint(0, MAX)
cnt = 1
isPrime = False
ISPRIME = False
continue
else:
if not FUCK:
print(f"Your best grade is {min(trys)} times.\nHave a nice day,{name.title()}.")
input()
break
else:
print(f"{name.upper()},you are a clown.")
input()
break
isPrime = True
num = int(num)
if isPrime and num != ans:
if num > ans:
print(tips[3]+"\n")
cnt += 1
isPrime = False
continue
else:
print(tips[2]+"\n")
cnt += 1
isPrime = False
continue
else:
trys.append(cnt)
print("Congratulations!\n")
print(f"Well,you have tried {cnt} times to guess it.")
choice = input("Do you want to play again?\nEnter y to play,enter the other to quit:")
if choice == 'y':
ans = random.randint(0, MAX)
cnt = 0
isPrime = False
continue
else:
if not FUCK:
print(f"Your best grade is {min(trys)} times.\nHave a nice day,{name.title()}.")
input()
break
else:
print(f"{name.title()},you are a clown.")
input()
break