You're given a piece of ASCII art representing a piece of land, like so:
/‾\ __/ ‾\_ \_/‾\ \
Since an overline (
‾) is not ASCII, you can use a
Your challenge is to determine if it is connected by the lines of the characters. For example, the above can be traced like so:
To clarify the connections:
_can only connect on the bottom on either side
-) can only connect on the top on either side
/can only connect on the top right and bottom left
\can only connect on the top left and bottom right
It doesn't matter where the connections start and end as long as they go all the way across. Note that one line's bottom is the next line's top, so stuff like this is allowed:
_ ‾ \ \ _ / \ ‾
You can assume input will only contain those characters plus spaces and newlines, and will only contain one non-space character per column.
Input can be taken as ASCII art, an array of rows, a character matrix, etc.
Separated by double newline.
\ \ \_ \ /\/\_ ‾ \ /\ \/ \_ ‾\ /‾\ __/ ‾\_ \_/‾\ \
/ \ // ‾‾ / \ ‾ _ \____/ /‾‾‾\