io.write([[#include "levels.h" #include void set_level(int level_id, char level[], unsigned int *coin_id) { switch (level_id) { ]]) current = 0 for i = 0, 9999, 1 do file = io.open("../up-editor/screens/"..i..".scr") file_content = nil if file then file_content = file:read() formated_file = "" for j = 1, #file_content, 1 do if j == 1 then formated_file = formated_file.."-----------------------------" end formated_file = formated_file..file_content:sub(j, j) if j % 26 == 0 then formated_file = formated_file.."--" end if j == 390 then formated_file = formated_file.."---------------------------" end end file:close() io.write(" case "..i..":\n memcpy(level, \"".. formated_file.."\", "..#formated_file..");\n") if file_content and string.find(file_content, 'c') then io.write(" *coin_id = "..current..";\n") current = current + 1 end io.write(" break;\n") end end io.write(" }\n}\n")