fork download
  1. f=lambda d,m:' NESSWNW'[ord(d)+ord(m)&7]
  2. for d in 'NESW':
  3. for m in '/\\':
  4. 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