def get_boards_list(main_node):
    """ Get the list of the state of the boards from the last node
    :param main_node: the last node
    :return: list of board states
    """
    boards = []
    node = main_node

    while True:
        if node is None:
            break
        else:
            boards.append(node.state)
            node = node.parent

    boards.reverse()

    return boards