AST3_C/time.py

33 lines
597 B
Python
Raw Normal View History

2020-08-16 15:20:20 +02:00
gold = 1.2
silver = 1.5
2020-08-16 15:20:20 +02:00
bronze = 2
2021-05-05 13:28:21 +02:00
x = 340
y = 140
2021-03-22 22:50:42 +01:00
timeslevel = open("times.lvl","r+")
dest = open("generated/times.c","w")
lvm = open("generated/include/define.h","r")
2021-03-22 22:50:42 +01:00
ids=timeslevel.readlines()
times=[]
2021-03-22 22:50:42 +01:00
for i in ids:
2021-03-22 22:50:42 +01:00
times.append(i.rstrip())
nblvl = int(''.join(filter(str.isdigit,lvm.readline())))
while(len(times) < nblvl):
times.append("0.00")
dest.write("""#include "times.h"
#include "define.h"
#include <gint/display.h>
#include <gint/keyboard.h>
2021-05-05 15:46:08 +02:00
extern bopti_image_t img_medals;
2021-05-05 15:46:08 +02:00
float level_time[] = {\n\t""")
dest.write("{}".format(',\n\t'.join(times)))
2021-05-05 15:46:08 +02:00
dest.write("\n};")