def against_wall(data, pos):
    """ Get a list of the directions of walls that the snake is adjacent to. """
    width = data['board']['width']
    height = data['board']['height']

    adjacent = []
    if pos['x'] == 0:
        adjacent.append("left")
    if pos['x'] == width - 1:
        adjacent.append("right")
    if pos['y'] == 0:
        adjacent.append("up")
    if pos['y'] == height - 1:
        adjacent.append("down")
    return adjacent