This is an "arrow maze":
v <
> v
> ^
> v
^ < *
The *
marks the spot where you will finish. Your goal is to find where the maze starts (hence, reverse maze). In this case, it's the first >
on the second line.
v------<
S-+---v |
| >--^
>-+-------v
^ < *
Note that all arrows must be used. Also note that you can assume the lines will be padded with spaces to equal length.
Your program must input the maze in any reasonable way (stdin, from a file, message box, etc.), however the maze must be completely intact. For example, you can't input the lines separated by commas; the input must be exactly the maze.
You must output the start of the maze in any reasonable way. For example, you could
- output the coordinates of the start
- output the entire maze with the start arrow replaced with an
S
- output the entire maze with all arrows except the start arrow removed (whitespace intact!)
- etc.
As long as you can tell by your output which arrow is the start arrow, then it's okay. For example, an output of
"0"
"2"
is alright, regardless of the newlines and quotes, because you can still tell where the start was.
This is code-golf, so the shortest code in bytes will win.
>v^
the>
is pointing to thev
, not the^
. I'll edit more stuff in when I get back home to a computer today. \$\endgroup\$