Skip to content

Commit 00b6ec8

Browse files
authored
Add files via upload
1 parent 6df6c1a commit 00b6ec8

File tree

2 files changed

+143
-0
lines changed

2 files changed

+143
-0
lines changed

HigherLowerGame/database.py

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
data = [
2+
{
3+
"name":"Akshay kumar",
4+
"follower":250000,
5+
"description":"Actor",
6+
"country":"India"
7+
},
8+
{
9+
"name": "Virat kohli",
10+
"follower": 5600000,
11+
"description": "Cricketer",
12+
"country": "India"
13+
},
14+
{
15+
"name": "T-series",
16+
"follower": 250000,
17+
"description": "music channel",
18+
"country": "India"
19+
},
20+
{
21+
"name": "carryminati",
22+
"follower": 3900000,
23+
"description": "youtuber",
24+
"country": "India"
25+
},
26+
{
27+
"name": "Samay raina",
28+
"follower": 200000,
29+
"description": "comedian",
30+
"country": "India"
31+
},
32+
{
33+
"name": "Cristiano ronaldo",
34+
"follower": 450000000,
35+
"description": "footballer",
36+
"country": "portugal"
37+
},
38+
{
39+
"name": "Ms dhoni",
40+
"follower": 4900000,
41+
"description": "Cricketer",
42+
"country": "India"
43+
}, {
44+
"name":"ishow speed",
45+
"follower":3330000,
46+
"description":"youtuber",
47+
"country":"palestine"
48+
},
49+
{
50+
"name": "salman khan",
51+
"follower": 2200000,
52+
"description": "Actor",
53+
"country": "India"
54+
},
55+
{
56+
"name":"jenny lecture",
57+
"follower":500000,
58+
"description":"youtuber",
59+
"country":"India",
60+
},
61+
]
62+
63+
64+
vs = '''
65+
66+
vs
67+
'''
68+
69+
logo = '''
70+
/$$ /$$ /$$ /$$
71+
| $$ |__/ | $$ | $$
72+
| $$$$$$$ /$$ /$$$$$$ | $$$$$$$ /$$$$$$ /$$$$$$ | $$ /$$$$$$ /$$ /$$ /$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$/$$$$ /$$$$$$
73+
| $$__ $$| $$ /$$__ $$| $$__ $$ /$$__ $$ /$$__ $$ | $$ /$$__ $$| $$ | $$ | $$ /$$__ $$ /$$__ $$ /$$__ $$ |____ $$| $$_ $$_ $$ /$$__ $$
74+
| $$ \ $$| $$| $$ \ $$| $$ \ $$| $$$$$$$$| $$ \__/ | $$| $$ \ $$| $$ | $$ | $$| $$$$$$$$| $$ \__/ | $$ \ $$ /$$$$$$$| $$ \ $$ \ $$| $$$$$$$$
75+
| $$ | $$| $$| $$ | $$| $$ | $$| $$_____/| $$ | $$| $$ | $$| $$ | $$ | $$| $$_____/| $$ | $$ | $$ /$$__ $$| $$ | $$ | $$| $$_____/
76+
| $$ | $$| $$| $$$$$$$| $$ | $$| $$$$$$$| $$ | $$| $$$$$$/| $$$$$/$$$$/| $$$$$$$| $$ | $$$$$$$| $$$$$$$| $$ | $$ | $$| $$$$$$$
77+
|__/ |__/|__/ \____ $$|__/ |__/ \_______/|__/ |__/ \______/ \_____/\___/ \_______/|__/ \____ $$ \_______/|__/ |__/ |__/ \_______/
78+
/$$ \ $$ /$$ \ $$
79+
| $$$$$$/ | $$$$$$/
80+
\______/ \______/
81+
82+
83+
84+
'''

HigherLowerGame/main.py

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import database
2+
import random
3+
import os
4+
5+
def account_selector(db):
6+
name = db["name"]
7+
description = db["description"]
8+
country = db["country"]
9+
followers = db["follower"]
10+
return f"{name} - a {description} from {country}"
11+
12+
def check_answer(follower_count,foll_count1,foll_count2):
13+
if foll_count1 < foll_count2:
14+
if follower_count == 1:
15+
return False
16+
else:
17+
return True
18+
#return print("Invalid input!,please choose from either 1 or 2.")
19+
20+
else:
21+
if follower_count == 1:
22+
return True
23+
else:
24+
return False
25+
26+
db2 = random.choice(database.data)
27+
score = 0
28+
flag = True
29+
while flag:
30+
print(database.logo)
31+
db1 = db2
32+
db2 = random.choice(database.data)
33+
while db1 == db2:
34+
db2 = random.choice(database.data)
35+
36+
print(f"compare 1: {account_selector(db1)}")
37+
print(database.vs)
38+
print(f"compare 2: {account_selector(db2)}")
39+
follower_count = int(input("Who has more followers count type 1 or type 2: "))
40+
foll_count1 = db1["follower"]
41+
foll_count2 = db2["follower"]
42+
43+
44+
is_correct = check_answer(follower_count, foll_count1, foll_count2)
45+
46+
47+
48+
os.system('cls')
49+
if is_correct:
50+
score += 1
51+
print(f"You are right, your score is {score}")
52+
else:
53+
if follower_count == 3:
54+
print("Invalid input!,please choose from either 1 or 2.")
55+
flag = False
56+
else:
57+
print(f"Your guess is wrong your score is {score}")
58+
flag = False
59+

0 commit comments

Comments
 (0)