diff --git a/fill.py b/fill.py new file mode 100755 index 0000000000000000000000000000000000000000..7af86c09e5089507ed36b716ae70a5ed2b87b23c --- /dev/null +++ b/fill.py @@ -0,0 +1,23 @@ +#!/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() diff --git a/toDot.py b/toDot.py new file mode 100755 index 0000000000000000000000000000000000000000..1bfac2622e141bff1e2154480e887684bfa2ffae --- /dev/null +++ b/toDot.py @@ -0,0 +1,43 @@ +#!/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()