-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathday47_100c.py
87 lines (73 loc) · 3.33 KB
/
day47_100c.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# OpenAIGPT3 Assisted Code
import random, os, time
cards = {
"Revel": {"Funding": 15600000, "Employees": 13, "CB Rank": 607, "Investors": 11},
"MSafe": {"Funding": 6300000, "Employees": 10, "CB Rank": 2556, "Investors": 9},
"Plugo": {"Funding": 9000000, "Employees": 50, "CB Rank": 3022, "Investors": 6},
"Xscape Photonics": {"Funding": 10000000, "Employees": 10, "CB Rank": 3127, "Investors": 1},
"Spaceport Technologies": {"Funding": 3600000, "Employees": 10, "CB Rank": 4498, "Investors": 10}
}
print("🌟Top Trumps: 2022 Startup Edition🌟")
print()
print("""Welcome to the Top Trumps 'Startup Battle' Simulator""")
print()
play_again = "y"
while play_again == "y":
selectCard = input("""Choose your card:
1 - Revel
2 - MSafe
3 - Plugo
4 - Xscape Photonics
5 - Spaceport Technologies
> """)
card_name = {
"1": "Revel",
"2": "MSafe",
"3": "Plugo",
"4": "Xscape Photonics",
"5": "Spaceport Technologies",
}.get(selectCard)
print()
select_startup_attrib = input("""Select a Startup Attribute:
1. Funding
2. Employees
3. CB Rank (Lower is Better)
4. Investors
> """)
startup_attrib = {
"1": "Funding",
"2": "Employees",
"3": "CB Rank",
"4": "Investors",
}.get(select_startup_attrib)
print()
print(f"""You have chosen: \033[0;36m{card_name}\033[0m and the attribute: \033[0;36m{startup_attrib}\033[0m
which has a value of : \033[0;36m{cards[card_name][startup_attrib]}\033[0m """)
random_startup = random.choice([startup for startup in cards.keys() if startup != card_name])
print(f"""The computer has chosen: \033[0;36m{random_startup}\033[0m and the attribute: \033[0;36m{startup_attrib}\033[0m
which has a value of : \033[0;36m{cards[random_startup][startup_attrib]}\033[0m """)
print()
if startup_attrib == 'CB Rank':
if cards[card_name][startup_attrib] < cards[random_startup][startup_attrib]:
print(f"""{card_name} wins with a CB Rank of {cards[card_name][startup_attrib]} against
{random_startup} with CB Rank of {cards[random_startup][startup_attrib]}""")
elif cards[card_name][startup_attrib] > cards[random_startup][startup_attrib]:
print(f"""{random_startup} wins with a CB Rank of {cards[random_startup][startup_attrib]} against
{card_name} with CB Rank of {cards[card_name][startup_attrib]}""")
else:
print("It's a tie with the CB Rank of {} for both startups".format(cards[random_startup][startup_attrib]))
else:
if cards[card_name][startup_attrib] > cards[random_startup][startup_attrib]:
print(f"""{card_name} wins with a value of
{cards[card_name][startup_attrib]} {startup_attrib} against
{random_startup} with value of {cards[random_startup][startup_attrib]} {startup_attrib}""")
elif cards[card_name][startup_attrib] < cards[random_startup][startup_attrib]:
print(f"""{random_startup} wins with a value of
{cards[random_startup][startup_attrib]} {startup_attrib} against
{card_name} with value of {cards[card_name][startup_attrib]} {startup_attrib} """)
else:
print("It's a tie with the value of {} {startup_attrib} for both startups".format(cards[random_startup][startup_attrib]))
play_again = input("Play again? (y/n) > ")
if play_again == "n":
"Thank you for playing, good bye!"
break