# [Röda], <s>405</s> 393 bytes *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!* 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!] [Röda]: https://github.com/fergusq/roda [Try it online!]: https://tio.run/nexus/roda#dZFhb4IwEIa/91d0bUx0woDPUD/6GyClGIRWWao4IQwC/HZ3RdRlyUig9z7v3XGX3rZY9YophyBSyS/sWlTZ3qD4TjD4eMIhRDNeldd6qazsdGH9kFr7gdM0oHsxrsSfqg/GCSbifUk1p9r2hE2nPquWuaiDN2QeiuDMGCHo@1hoybM3Rnwi8hJp@GknMqZ5KxDPBOoh3Yf0sVAcKjZkQvZvFtyZC8ibUfNC9oMlhqUs9KE8MkY6G87LMPyB4xg45Ib4rgeQUBXNcjdPEppW0VxDAbZrFqKWtQuqUbdmESzdLagynGpT3AauMA5VRnWg8vIsx9spLc64RxjXsqqztJIVZpiTBptn06BNus8ax/HRQck8SIojsfC/rvGA5FL5j3B4RvQZxbGPTIOdAYk/dcmlg3DyWRwPgaFTbuCnsBqkqvL6nA/DvK9Z4fZMp@0TTfJyLc41hpvG2GyJxtsP "Röda – TIO Nexus" 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.