A cyclic direction class to make rotations easier.
d = Direction(idx=0)
#currently facing north
assert d.get_idx()==0
assert repr(d.f) == "'NORTH'"
#calling left changes idx to 3 and str representation to 'WEST'
assert d.left().get_idx()==3
assert repr(d.left().f) == "'WEST'"
#can do multiple lefts or left and right combination
assert d.left().left().get_idx()==2
assert d.left().right().get_idx()==0
from nbdev.export import *
notebook2script()