I changed the entrance and exit detection code a bit so know it it can pretty much work on any rectangular maze. There is just a few more things that need to be changed to make it solid. I’ve also thought about another method to detect the entrance and exit where you would trace along the outside of the maze and look for breaks in the border. I’m not sure how well this would work though as It seems my way could be change to suit non-rectangle mazes more easliy. I’ll probably have to implement both ways and compare them.
I leave you with pretty images of some examples of sample data sets and the output.