Skip to main content
4 of 17
added 74 characters in body
user41805
  • 13.2k
  • 6
  • 42
  • 88

Röda, 405 393 392 bytes

F f{f=f/"
"seq 0,#f-1|f[_]=f[_1]/""l=[sort(f,cmp={|a,b|[#a<#b]})]seq 0,#f-1|f[_].=[" "]*(#l[#l-1]-#f[_1])x=0
y=0
X=1
Y=0
c=""
while[c!=";"]do
l=f[y]c=l[x]
[c]
{X=1;Y=0}if[c=">"]
{X=-1;Y=0}if[c="<"]
{X=0;Y=1}if[c="v"]
{X=0;Y=-1}if[c="^"]
{a=X;X=-Y;Y=-a}if[c="/"]
{a=X;X=Y;Y=a}if[c=`\`]
X=-X if[c="|"]
Y=-Y if[c="_"]
{X=-X;Y=-Y}if[c="#"]
x+=X
x=x%#l
y+=Y
y=y%#f
x+=#l if[x<0]
y+=#f if[y<0]done}

Try it online!

Some 20-30 bytes go to parsing the input (I have asked the OP for a more relaxed input format and am now waiting for their response) and 80-ish bytes go to padding spaces when necessary.

###Edits

  • 10 bytes saved thanks to @fergusq by using % instead of checking whether x or y is over the boundaries, which paved the way for 2 more!
  • Used `\</code> instead of "\"`
user41805
  • 13.2k
  • 6
  • 42
  • 88