experimental distributed hashtable implementations with 2D topology
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

15 lines
311 B

class Direction(object):
'''
enum hack, allowing cardinal arithmetics:
NORTH == -SOUTH
LOCAL == NORTH + SOUTH
NORTHWEST = NORTH | WEST
'''
NORTH = 0b01
WEST = 0b10
SOUTH = -0b01
EAST = -0b10
LOCAL = 0
cardinals = [NORTH, WEST, SOUTH, EAST]
D = Direction