Skip to content
Extraits de code Groupes Projets
Valider 542b4c3b rédigé par Elliu's avatar Elliu
Parcourir les fichiers

Add files for 2022 election

parent 65ba4638
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
#!/bin/env python3
listes = ["", "che", "com", "fii", "hur", "iik", "ani", "lab", "ove"]
nbListes = len(listes)-1
with open('results.txt','r') as data:
o = open('results_out.txt','w')
for line in data.readlines():
for column in range(1,10):
first = True
found = False
for ind in range(0,nbListes):
if int(line[ind]) != column:
continue
if not first:
o.write(" = ")
o.write(listes[ind+1])
first = False
found = True
if found and column < nbListes:
o.write(" > ")
o.write("\n")
o.close()
#!/bin/env python3
import yaml
translate = {
"che" : "ChevalerIIE",
"com" : "ComplotIIstE",
"fii" : "FIIPALE",
"hur" : "HURRICANE",
"iik" : "IIKEA",
"ani" : "L'ANiMALERie",
"ove" : "OVERDRIIVE",
"lab" : "Labyriinthe"
}
colors = {
"che" : "#C50000",
"com" : "#39AA30",
"fii" : "#0C631E",
"hur" : "#6AD5CF",
"iik" : "#1B56D3",
"ani" : "#FF00FF",
"ove" : "#EF7A37",
"lab" : "#CF9F00"
}
with open('input.yaml','r') as data:
dic = yaml.safe_load(data)
o = open("results.dot", "w")
o.write("""
Digraph G {
node [shape="plaintext"];
""")
for liste in dic:
o.write(liste + " [label=\"" + translate[liste] + "\" fontcolor=\"" + colors[liste] + "\"]\n")
o.write("\n")
for liste in dic:
for opp in dic[liste]["win"]:
if dic[liste]["win"][opp] > dic[opp]["win"][liste]:
o.write(liste + " -> " + opp + "[penwidth=2 headlabel=\"" + str(dic[liste]["win"][opp]) + "\" labeldistance=3 color=\"" + colors[liste] + "\" fontcolor=\"" + colors[liste] + "\"]\n")
o.write("}\n")
o.close()
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter