Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function mapa.read(path)
- local map = {};
- if files.exists(path) then
- file = io.open(path);
- for line in file:lines() do
- table.insert(map,{})
- for k = 1, #line do
- table.insert(map[#map],tostring(string.sub(line,k,k)))
- end
- end
- file:close();
- end
- return map;
- end
- function mapa.save(map,path)
- if files.exists(path) then
- file = io.open(path,"w+");
- for i =1, #map do
- file:write(string.implode(map[i]).."\n");
- end
- file:flush();
- file:close();
- return true;
- end
- return false;
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement