def findXCoordinateFromDirection(direction):
    """ Returns delta X, when given a direction value """
    if direction in (1, 5):
        return 0
    elif direction in (2, 3, 4):
        return 2
    elif direction in (6, 7, 8):
        return -2
    else:
        error_template = "Unexpected direction value of: {0}"
        raise ValueError(error_template)