f=lambda d,m:' NESSWNW'[ord(d)+ord(m)&7]for d in 'NESW': for m in '/\\': print d, m, ' --> ', f(d,m)
Standard input is empty
N / --> W N \ --> E E / --> S E \ --> N S / --> E S \ --> W W / --> N W \ --> S
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!