forked from Kelder/ceneka-bot-battle
Compare commits
10 commits
Author | SHA1 | Date | |
---|---|---|---|
887c4a3f16 | |||
9f2e76c770 | |||
aaba4df2a3 | |||
c8d1261f5d | |||
9cc0767c3e | |||
533526e561 | |||
7e16cc304c | |||
96545cc849 | |||
22e589f62e | |||
032352d298 |
2 changed files with 13 additions and 11 deletions
20
main.py
20
main.py
|
@ -3,17 +3,18 @@ from flask import Flask, jsonify, render_template
|
||||||
|
|
||||||
users = {
|
users = {
|
||||||
"local_klink": "Francis",
|
"local_klink": "Francis",
|
||||||
"awful_lickilicky": "geen-zeuser",
|
"naive_persian": "Vincent",
|
||||||
"decisive_grookey": "geen",
|
"punctual_pyroar": "Seppe",
|
||||||
"sweet_munna": "geen",
|
"unmotivated_tentacruel": "Tybo",
|
||||||
"lazy_pichu": "geen",
|
"outgoing_torchic": "Mathieu",
|
||||||
"stupid_magikarp": "geen",
|
"mercurial_celebi": "Rune",
|
||||||
"superficial_gigalith": "geen",
|
"sloppy_golem": "Elias",
|
||||||
"ugly_kingdra": "geen",
|
"excellent_wishiwashi": "Xander",
|
||||||
|
"dainty_snubbull": "Saturn",
|
||||||
}
|
}
|
||||||
|
|
||||||
def get_game_data():
|
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'])
|
return sorted(res.json(), key=lambda x: x['gid'])
|
||||||
|
|
||||||
def get_data():
|
def get_data():
|
||||||
|
@ -49,7 +50,8 @@ def process_game_data(game_data):
|
||||||
'bots': bots,
|
'bots': bots,
|
||||||
'min_elo': min_elo,
|
'min_elo': min_elo,
|
||||||
'max_elo': max_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):
|
def filter_date(data):
|
||||||
|
|
|
@ -99,9 +99,9 @@
|
||||||
ctx.lineWidth = 4
|
ctx.lineWidth = 4
|
||||||
ctx.strokeStyle = bot.color_ring
|
ctx.strokeStyle = bot.color_ring
|
||||||
ctx.beginPath()
|
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++) {
|
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()
|
ctx.stroke()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue