fork download
  1. f=lambda d,m,x='NESW'*2:x[x.find(d)+2*(m=='/\\'[d in'NS'])-1]
  2.  
  3. for d in 'NESW':
  4. for m in '/\\':
  5. print d, m, '-->', f(d, m)
Success #stdin #stdout 0s 9024KB
stdin
Standard input is empty
stdout
N / --> W
N \ --> E
E / --> S
E \ --> N
S / --> E
S \ --> W
W / --> N
W \ --> S