-
Notifications
You must be signed in to change notification settings - Fork 0
/
games.py
57 lines (49 loc) · 1.45 KB
/
games.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
import random
def random_num(arg2, arg3):
arg4 = random.randint(arg2, arg3)
return arg4
if textperm == "True":
print(arg4)
def text(arg):
print(arg)
def guess_the_num():
randomnumber = random_num(1, 100000)
text("Guess the number")
while True:
playernumber = int(input(">>> "))
if playernumber > randomnumber:
text("You Passed It")
if playernumber < randomnumber:
text("You Havent Passed It")
if playernumber == randomnumber:
text("You Won!")
if playernumber == "break":
break
else:
text("This game aint existing")
def dice(leave_empty_with_commas):
if leave_empty_with_commas == "help":
print("it aint a game but it is something")
computer_choice = random.randint(1, 6)
your_choice = input("Roll the dice y/n ")
if your_choice == "y":
your_choice = random.randint(1, 6)
print(f"Your dice rolled {your_choice}")
print(f"while the computer rolled {computer_choice}")
else:
print("see ya")
def timer(seconds):
start = input("Start >>> ")
if start == "yes" or start == "Yes":
def clear():
import os
os.system("clear")
second = seconds
while True:
second -= 1
print(second)
clear()
time.sleep(1)
if second == 0:
break
print("It finished!")