fork download
  1. E,N,W,S=*0..3
  2. x,y,i=eval"a="+gets
  3. gets.bytes{|c|x+=c%2*1.i**i=i+1-c&3}
  4. $><<[(x+y.i).rect,"NWSE"[i]]*?,
Success #stdin #stdout 0.01s 7420KB
stdin
1,2,N
MRMLM
stdout
2,4,N