In the maze, P is path, W is wall, and E is exit. For example here is maze.txt:
8 7 5 4 EWWWWWW PPPPPPW WWPWWPW WPPWWPW WPWWWWW WPPPPWW WWWWWWW WWWWWWW