Compare commits

...

10 commits
main ... main

Author SHA1 Message Date
fk
887c4a3f16
s/,/:/ 2024-10-21 18:17:59 +02:00
fk
9f2e76c770
add Xander and Saturn 2024-10-21 18:15:26 +02:00
fk
aaba4df2a3
add elias 2024-10-17 17:59:17 +02:00
fk
c8d1261f5d
only show last 5000 games 2024-10-11 11:51:55 +02:00
fk
9cc0767c3e
add rune 2024-10-09 14:54:44 +02:00
fk
533526e561
add mathieu 2024-10-09 14:52:12 +02:00
fk
7e16cc304c
add tybo 2024-10-09 14:31:05 +02:00
fk
96545cc849
add seppe 2024-10-07 18:28:44 +02:00
fk
22e589f62e
add vincent 2024-10-07 17:45:16 +02:00
fk
032352d298 Merge pull request 'optimize dockerfile' (#2) from axdzitte/ceneka-bot-battle:main into main
Reviewed-on: Kelder/ceneka-bot-battle#2
Reviewed-by: Mathieu Strypsteen <mathieu@strypsteen.me>
Reviewed-by: fk <fk@noreply.localhost>
2024-10-04 18:15:47 +02:00
2 changed files with 13 additions and 11 deletions

20
main.py
View file

@ -3,17 +3,18 @@ from flask import Flask, jsonify, render_template
users = {
"local_klink": "Francis",
"awful_lickilicky": "geen-zeuser",
"decisive_grookey": "geen",
"sweet_munna": "geen",
"lazy_pichu": "geen",
"stupid_magikarp": "geen",
"superficial_gigalith": "geen",
"ugly_kingdra": "geen",
"naive_persian": "Vincent",
"punctual_pyroar": "Seppe",
"unmotivated_tentacruel": "Tybo",
"outgoing_torchic": "Mathieu",
"mercurial_celebi": "Rune",
"sloppy_golem": "Elias",
"excellent_wishiwashi": "Xander",
"dainty_snubbull": "Saturn",
}
def get_game_data():
res = requests.get("https://botbattle.be/api/games")
res = requests.get("https://botbattle.be/api/games?num=5000")
return sorted(res.json(), key=lambda x: x['gid'])
def get_data():
@ -49,7 +50,8 @@ def process_game_data(game_data):
'bots': bots,
'min_elo': min_elo,
'max_elo': max_elo,
'game': game_data[-1]['gid'],
'min_game': game_data[0]['gid'],
'max_game': game_data[-1]['gid'],
}
def filter_date(data):

View file

@ -99,9 +99,9 @@
ctx.lineWidth = 4
ctx.strokeStyle = bot.color_ring
ctx.beginPath()
ctx.moveTo(getX(width, margin, 0, graph_data.game, bot.x[0]), getY(height, margin, graph_data.min_elo, graph_data.max_elo, bot.y[0]))
ctx.moveTo(getX(width, margin, graph_data.min_game, graph_data.max_game, bot.x[0]), getY(height, margin, graph_data.min_elo, graph_data.max_elo, bot.y[0]))
for (let i = 1; i < bot.x.length; i++) {
ctx.lineTo(getX(width, margin, 0, graph_data.game, bot.x[i]), getY(height, margin, graph_data.min_elo, graph_data.max_elo, bot.y[i]))
ctx.lineTo(getX(width, margin, graph_data.min_game, graph_data.max_game, bot.x[i]), getY(height, margin, graph_data.min_elo, graph_data.max_elo, bot.y[i]))
}
ctx.stroke()
}