map validation
Closed this issue · 1 comments
inticoy commented
- The map must be rectangular
- The map must be closed/surrounded by walls
- You have to check if there's a valid path in the map
- You must be able to parse any kind of map, as long as it respects the above rules.
- If any misconfiguration of any kind is encountered in the file, the program must exit in a clean way, and return "Error\n" followed by an explicit message of your choice.
inticoy commented
- Open map file by "open"
-> if return value of O_DIRECTORY > 0 : directory
-> if return value of O_RDONLY < 0 : unavailable - Get number of lines of map file by "get_num_line(path)"
- malloc char **
- while get_next_line
- check rectangular
- check closed by walls
- check E, P, C
- check valid path