def index_to_rooms(maze_x, rooms):
    """
    This function replaces maze lists of indexes with room objects
    :param maze_x: Maze to be recast into rooms
    :param rooms: List of possible rooms
    :return: List describing maze layout with room objects
    """
    i = 0
    for x in maze_x:
        j = 0

        for y in x:
            maze_x[i][j] = rooms[y]
            j += 1

        i += 1

    return maze_x