Skip to main content
9 of 17
deleted 603 characters in body
user41805
  • 13.2k
  • 6
  • 42
  • 88

Röda, 405 393 392 391 371 366 bytes

F f{f=f/"
"l=[sort(f,cmp={|a,b|[#a<#b]})]seq 0,#f-1|f[_].=" "*(#l[#l-1]-#f[_1])c=""x=0
y=0
X=1
Y=0
{l=f[y]C=l/""c=C[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]}while[c!=";"]}

Try it online!

Check outputs!

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 "\"`
  • Moved c="" to the second line and then removed the newline following it
  • Moved the conversion of the lines to single-character array into the loops instead of at the beginning
  • Used the brace syntax of while (thanks to @fergusq for spotting that)
user41805
  • 13.2k
  • 6
  • 42
  • 88