Hello!
I have a maze 4x6
[[False True False False True False]
[False True True True True False]
[False True False True False False]
[False False False False False False]]

where true is the entrance and exit. I want to assign to the right true the entrance, and to the left one the exit. I need a general function because then I have to use the same function to find entrance and exit of different mazes with different lenght and width, where the entrance and exit are in a different position from now.
Any suggestion please?
thanks in advance
(Python)

Any true on the top/right/bottom/left edge is an entry or exit, so you just need to loop round those locations looking for two true values

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.