def cell_neighbors(mfield, x, y):
    """
    Function cell_neighbors returns all the neighboring cells for a cell at a
    given x, y coordinate. Returns a dictionary of strings representing compass
    directions to their neighbor cell.
    """
    deltas = {'N': (0, -1), 'NE': (1, -1), 'E': (1, 0), 'SE': (1, 1), 'S':
        (0, 1), 'SW': (-1, 1), 'W': (-1, 0), 'NW': (-1, -1)}
    rv = dict()
    for k in deltas.keys():
        delt = deltas[k]
        nx, ny = map(lambda a, b: a + b, (x, y), delt)
        if nx in range(mfield.width) and ny in range(mfield.height):
            rv[k] = mfield.board[nx][ny]
        else:
            rv[k] = None
    return rv
