-
Notifications
You must be signed in to change notification settings - Fork 0
/
WBWAnimeTournament2023.py
339 lines (308 loc) · 15.3 KB
/
WBWAnimeTournament2023.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
# Match schedule with results
match_schedule = {
'Group A': [
('Mobile Suit Gundam: The Witch from Mercury S2',
'Vinland Saga S2 (2nd cour)', 50, 21),
('Mobile Suit Gundam: The Witch from Mercury S2', 'Skip and Loafer', 68, 4),
('Mobile Suit Gundam: The Witch from Mercury S2',
'Kuma Kuma Kuma Bear - Punch!', 29, 57),
('Vinland Saga S2 (2nd cour)', 'Skip and Loafer', 41, 8),
('Vinland Saga S2 (2nd cour)', 'Kuma Kuma Kuma Bear - Punch!', 16, 38),
('Skip and Loafer', 'Kuma Kuma Kuma Bear - Punch!', 13, 42)
],
'Group B': [
('My Love Story with Yamada-kun at Lv999!',
'My Clueless First Friend', 45, 4),
('My Love Story with Yamada-kun at Lv999!', 'Yuri is My Job!', 49, 13),
('My Love Story with Yamada-kun at Lv999!', 'Dr. STONE New World', 16, 64),
('My Clueless First Friend', 'Yuri is My Job!', 10, 51),
('My Clueless First Friend', 'Dr. STONE New World', 11, 47),
('Yuri is My Job!', 'Dr. STONE New World', 19, 62)
],
'Group C': [
('The Aristocrat\'s Otherworldly Adventure: Serving Gods Who Go Too Far',
'KamiKatsu: Working for God in a Godless World', 51, 6),
('The Aristocrat\'s Otherworldly Adventure: Serving Gods Who Go Too Far',
'Hell\'s Paradise', 16, 55),
('The Aristocrat\'s Otherworldly Adventure: Serving Gods Who Go Too Far',
'Insomniacs After School', 45, 18),
('KamiKatsu: Working for God in a Godless World', 'Hell\'s Paradise', 22, 42),
('KamiKatsu: Working for God in a Godless World',
'Insomniacs After School', 41, 14),
('Hell\'s Paradise', 'Insomniacs After School', 68, 9)
],
'Group D': [
('The Reason Why Raeliana Ended up at the Duke\'s Mansion',
'Dead Mount Death Play', 45, 12),
('The Reason Why Raeliana Ended up at the Duke\'s Mansion',
'BIRDIE WING -Golf Girls’ Story- S2', 35, 25),
('The Reason Why Raeliana Ended up at the Duke\'s Mansion', 'Oshi no Ko', 17, 52),
('Dead Mount Death Play', 'BIRDIE WING -Golf Girls’ Story- S2', 42, 9),
('Dead Mount Death Play', 'Oshi no Ko', 19, 79),
('BIRDIE WING -Golf Girls’ Story- S2', 'Oshi no Ko', 20, 67)
],
'Group E': [
('Ranking of Kings: Treasure Chest of Courage',
'MASHLE: MAGIC AND MUSCLES', 23, 46),
('Ranking of Kings: Treasure Chest of Courage', 'Blue Orchestra', 54, 14),
('Ranking of Kings: Treasure Chest of Courage',
'Kubo Won\'t Let Me Be Invisible (2nd cour)', 20, 45),
('MASHLE: MAGIC AND MUSCLES', 'Blue Orchestra', 72, 10),
('MASHLE: MAGIC AND MUSCLES',
'Kubo Won\'t Let Me Be Invisible (2nd cour)', 40, 25),
('Blue Orchestra', 'Kubo Won\'t Let Me Be Invisible (2nd cour)', 7, 69)
],
'Group F': [
('The Café Terrace and Its Goddesses', 'The Dangers in My Heart', 36, 39),
('The Café Terrace and Its Goddesses', 'Otaku Elf', 50, 19),
('The Café Terrace and Its Goddesses',
'Demon Slayer: Kimetsu no Yaiba Swordsmith Village Arc', 21, 52),
('The Dangers in My Heart', 'Otaku Elf', 47, 27),
('The Dangers in My Heart',
'Demon Slayer: Kimetsu no Yaiba Swordsmith Village Arc', 13, 57),
('Otaku Elf', 'Demon Slayer: Kimetsu no Yaiba Swordsmith Village Arc', 17, 52)
],
'Group G': [
('In Another World With My Smartphone S2', 'My Home Hero', 28, 54),
('In Another World With My Smartphone S2', 'A Galaxy Next Door', 30, 48),
('In Another World With My Smartphone S2',
'My One-Hit Kill Sister', 63, 21),
('My Home Hero', 'A Galaxy Next Door', 49, 24),
('My Home Hero', 'My One-Hit Kill Sister', 48, 22),
('A Galaxy Next Door', 'My One-Hit Kill Sister', 39, 34)
],
'Group H': [
('The Ancient Magus\' Bride S2', 'Tengoku-Daimakyou', 27, 35),
('The Ancient Magus\' Bride S2',
'I Got a Cheat Skill in Another World and Became Unrivaled in The Real World, Too', 15, 43),
('The Ancient Magus\' Bride S2',
'TONIKAWA: Over The Moon For You S2', 42, 25),
('Tengoku-Daimakyou', 'I Got a Cheat Skill in Another World and Became Unrivaled in The Real World, Too', 42, 27),
('Tengoku-Daimakyou', 'TONIKAWA: Over The Moon For You S2', 22, 49),
('I Got a Cheat Skill in Another World and Became Unrivaled in The Real World, Too',
'TONIKAWA: Over The Moon For You S2', 32, 48)
],
'Knock Out': [
('My Home Hero', 'My Love Story with Yamada-kun at Lv999!', 19, 45),
('Hell\'s Paradise', 'The Dangers in My Heart', 45, 41),
('Mobile Suit Gundam: The Witch from Mercury S2',
'TONIKAWA: Over The Moon For You S2', 61, 24),
('The Aristocrat\'s Otherworldly Adventure: Serving Gods Who Go Too Far',
'MASHLE: MAGIC AND MUSCLES', 39, 27),
('Dr. STONE New World',
'The Reason Why Raeliana Ended up at the Duke\'s Mansion', 71, 9),
('Oshi no Ko',
'Kubo Won\'t Let Me Be Invisible (2nd cour)', 82, 48),
('A Galaxy Next Door',
'Kuma Kuma Kuma Bear - Punch!', 8, 69),
('Demon Slayer: Kimetsu no Yaiba Swordsmith Village Arc',
'Tengoku-Daimakyou', 80, 13),
('My Love Story with Yamada-kun at Lv999!', 'Hell\'s Paradise', 22, 54),
('TONIKAWA: Over The Moon For You S2',
'The Aristocrat\'s Otherworldly Adventure: Serving Gods Who Go Too Far', 55, 22),
('Dr. STONE New World','Oshi no Ko', 21, 72),
('Kuma Kuma Kuma Bear - Punch!','Demon Slayer: Kimetsu no Yaiba Swordsmith Village Arc', 52, 31),
('Hell\'s Paradise','TONIKAWA: Over The Moon For You S2', 41, 31),
('Oshi no Ko','Kuma Kuma Kuma Bear - Punch!', 30, 52),
('TONIKAWA: Over The Moon For You S2','Oshi no Ko', 53, 19),
('Kuma Kuma Kuma Bear - Punch!','Hell\'s Paradise', 85, 36)
]
}
# Update leaderboard based on match results
leaderboard = {
'Group A': [
['Mobile Suit Gundam: The Witch from Mercury S2', 0, 0, 0, 0, 0, 0],
['Vinland Saga S2 (2nd cour)', 0, 0, 0, 0, 0, 0],
['Skip and Loafer', 0, 0, 0, 0, 0, 0],
['Kuma Kuma Kuma Bear - Punch!', 0, 0, 0, 0, 0, 0]
],
'Group B': [
['My Love Story with Yamada-kun at Lv999!', 0, 0, 0, 0, 0, 0],
['My Clueless First Friend', 0, 0, 0, 0, 0, 0],
['Yuri is My Job!', 0, 0, 0, 0, 0, 0],
['Dr. STONE New World', 0, 0, 0, 0, 0, 0]
],
'Group C': [
['The Aristocrat\'s Otherworldly Adventure: Serving Gods Who Go Too Far',
0, 0, 0, 0, 0, 0],
['KamiKatsu: Working for God in a Godless World', 0, 0, 0, 0, 0, 0],
['Hell\'s Paradise', 0, 0, 0, 0, 0, 0],
['Insomniacs After School', 0, 0, 0, 0, 0, 0]
],
'Group D': [
['The Reason Why Raeliana Ended up at the Duke\'s Mansion', 0, 0, 0, 0, 0, 0],
['Dead Mount Death Play', 0, 0, 0, 0, 0, 0],
['BIRDIE WING -Golf Girls’ Story- S2', 0, 0, 0, 0, 0, 0],
['Oshi no Ko', 0, 0, 0, 0, 0, 0]
],
'Group E': [
['Ranking of Kings: Treasure Chest of Courage', 0, 0, 0, 0, 0, 0],
['MASHLE: MAGIC AND MUSCLES', 0, 0, 0, 0, 0, 0],
['Blue Orchestra', 0, 0, 0, 0, 0, 0],
['Kubo Won\'t Let Me Be Invisible (2nd cour)', 0, 0, 0, 0, 0, 0]
],
'Group F': [
['The Café Terrace and Its Goddesses', 0, 0, 0, 0, 0, 0],
['The Dangers in My Heart', 0, 0, 0, 0, 0, 0],
['Otaku Elf', 0, 0, 0, 0, 0, 0],
['Demon Slayer: Kimetsu no Yaiba Swordsmith Village Arc', 0, 0, 0, 0, 0, 0]
],
'Group G': [
['In Another World With My Smartphone S2', 0, 0, 0, 0, 0, 0],
['My Home Hero', 0, 0, 0, 0, 0, 0],
['A Galaxy Next Door', 0, 0, 0, 0, 0, 0],
['My One-Hit Kill Sister', 0, 0, 0, 0, 0, 0]
],
'Group H': [
['The Ancient Magus\' Bride S2', 0, 0, 0, 0, 0, 0],
['Tengoku-Daimakyou', 0, 0, 0, 0, 0, 0],
['I Got a Cheat Skill in Another World and Became Unrivaled in The Real World, Too', 0, 0, 0, 0, 0, 0],
['TONIKAWA: Over The Moon For You S2', 0, 0, 0, 0, 0, 0]
],
'Knock Out': [
['My Home Hero', 0, 0, 0, 0, 0, 0],
['My Love Story with Yamada-kun at Lv999!', 0, 0, 0, 0, 0, 0],
['Hell\'s Paradise', 0, 0, 0, 0, 0, 0],
['The Dangers in My Heart', 0, 0, 0, 0, 0, 0],
['Mobile Suit Gundam: The Witch from Mercury S2', 0, 0, 0, 0, 0, 0],
['TONIKAWA: Over The Moon For You S2', 0, 0, 0, 0, 0, 0],
['The Aristocrat\'s Otherworldly Adventure: Serving Gods Who Go Too Far',
0, 0, 0, 0, 0, 0],
['MASHLE: MAGIC AND MUSCLES', 0, 0, 0, 0, 0, 0],
['Dr. STONE New World', 0, 0, 0, 0, 0, 0],
['The Reason Why Raeliana Ended up at the Duke\'s Mansion', 0, 0, 0, 0, 0, 0],
['Oshi no Ko', 0, 0, 0, 0, 0, 0],
['Kubo Won\'t Let Me Be Invisible (2nd cour)', 0, 0, 0, 0, 0, 0],
['A Galaxy Next Door', 0, 0, 0, 0, 0, 0],
['Kuma Kuma Kuma Bear - Punch!', 0, 0, 0, 0, 0, 0],
['Demon Slayer: Kimetsu no Yaiba Swordsmith Village Arc', 0, 0, 0, 0, 0, 0],
['Tengoku-Daimakyou', 0, 0, 0, 0, 0, 0]
]
}
# Update leaderboard based on match results
for group, matches in match_schedule.items():
for match in matches:
team1, team2, goals1, goals2 = match[0], match[1], match[2], match[3]
# Find the corresponding teams in the leaderboard
team1_data = next(
(team for team in leaderboard[group] if team[0] == team1), None)
team2_data = next(
(team for team in leaderboard[group] if team[0] == team2), None)
# Check if the match has begun (non-zero goals)
if goals1 != 0 or goals2 != 0:
# Update match count
team1_data[1] += 1
team2_data[1] += 1
# Update win, draw, and lose count based on goals
if goals1 > goals2:
team1_data[2] += 1
team2_data[4] += 1
elif goals1 < goals2:
team1_data[4] += 1
team2_data[2] += 1
else:
team1_data[3] += 1
team2_data[3] += 1
# Update goal differences and points
team1_data[5] += goals1 - goals2
team2_data[5] += goals2 - goals1
if goals1 > goals2:
team1_data[6] += 3
elif goals1 < goals2:
team2_data[6] += 3
else:
team1_data[6] += 1
team2_data[6] += 1
# Generate the leaderboard table
leaderboard_table = []
# Sort teams within each group based on points and goal differences
for group, teams in leaderboard.items():
sorted_teams = sorted(teams, key=lambda x: (x[6], x[5]), reverse=True)
leaderboard_table.append(sorted_teams)
# Print the leaderboard table
for group, teams in zip(match_schedule.keys(), leaderboard_table):
print(f"{group}")
print("Rank | Team | Match | Win | Draw | Lose | Differences (+/-) | Points")
for rank, team in enumerate(teams, start=1):
print(
f"{rank:<4} | {team[0]:<80} | {team[1]} | {team[2]} | {team[3]} | {team[4]} | {team[5]:<16} | {team[6]:<6}")
print()
anime_votes = {}
anime_matches = {}
# Calculate total votes and total matches for each anime
for group, matches in match_schedule.items():
for match in matches:
team1, team2, goals1, goals2 = match[0], match[1], match[2], match[3]
# Update total votes for team1
if team1 in anime_votes:
anime_votes[team1] += goals1
else:
anime_votes[team1] = goals1
# Update total votes for team2
if team2 in anime_votes:
anime_votes[team2] += goals2
else:
anime_votes[team2] = goals2
# Update total matches for team1
if goals1 != 0 or goals2 != 0:
if team1 in anime_matches:
anime_matches[team1] += 1
else:
anime_matches[team1] = 1
# Update total matches for team2
if goals1 != 0 or goals2 != 0:
if team2 in anime_matches:
anime_matches[team2] += 1
else:
anime_matches[team2] = 1
# Sort anime based on total votes
sorted_anime = sorted(anime_votes.items(), key=lambda x: x[1], reverse=True)
# Calculate total votes and total matches
total_votes = sum(anime_votes.values())
total_matches = sum(anime_matches.values())
# Generate the statistics table
statistics_table = []
for rank, (anime, votes) in enumerate(sorted_anime, start=1):
vote_percentage = (votes / total_votes) * 100 if total_votes != 0 else 0
matches = anime_matches.get(anime, 0)
average_vote = votes / matches if matches != 0 else 0
statistics_table.append(
[rank, anime, votes, vote_percentage, matches, average_vote])
# Sort the statistics table based on the number of votes in descending order
statistics_table.sort(key=lambda x: x[2], reverse=True)
rounded_total_matches = round(total_matches / 2)
rounded_total_votes = round(total_votes / rounded_total_matches)
print()
print("VOTE LEADERBOARD")
# Find the anime with the highest total votes
# Assumes the statistics_table is already sorted
highest_votes_anime = statistics_table[0]
# Create the line with information about the anime with the highest total votes
highest_votes_line = f"-🥇 HIGHEST VOTES TITLE 🥇(wait for tournament end for the official result): \033[33m{highest_votes_anime[1]}\033[0m"
# Print the statistics table ranked by number of votes
print("Rank | Anime | Total Votes | Average votes per match | Vote % | Total Matches")
for rank, anime, votes, vote_percentage, matches, average_vote in statistics_table:
print(f"{rank:<4} | {anime:<80} | {votes:<11} | {average_vote:<5.2f} | {vote_percentage:<5.2f} | {matches:<13}")
print()
print(f"- Total votes: \033[33m{total_votes}\033[0m ")
print(
f"- Tournament voting goal: \033[34m{total_votes/10000*100:.2f}%\033[0m ")
print(
f"- Average votes: \033[31m{rounded_total_votes}\033[0m ")
print(
f"- Total matches: \033[36m{rounded_total_matches}\033[0m")
print(highest_votes_line)
print("🏆 [WBW] ANIME VOTE TOURNAMENT SUMMER 2023 CHAMPION 🏆: \033[33mHell's Paradise\033[0m")
print()
print("INTERESTING STATISTICS")
print("- ... will be completed after the tournament")
print()
print("NOTE")
print("- The **Max** total matches | Total matches = (3) is for group stage, (4) is for 1/16 round, (5) is for quarter final, (6) is for semi final, (7) is for final or 3rd place match")
print("- The **Vote%** column provides interesting statistics and serves as a reference, indicating the percentage of votes each anime received.")
print("- The **Average vote** column shows the average votes received by an anime, this can be use for estimated the popularity of the anime at relative level.")
print("- The **Total Votes** column shows the total votes received by an anime.")
print("- The **Total Matches** column shows the number of matches each anime participated in.")
print("- These statistics can provide insights into the popularity and involvement of each anime in the tournament.")
print("TOURNAMENT IN https://discord.gg/wbw | PLEASE CONSIDER JOINING TO PARTICIPATE AND SUPPORT US")
print("\n" * 8)