import is_goal
import Sucessors






def maze_opt(path):
    """maze search heuristic going to have to use the euclidian distance, so it works for any maze"""
    state = path[-1]
    return (is_goal.MAZE_GOAL[0] - state[0])**2 + (is_goal.MAZE_GOAL[1] - state[1])**2


def puzzle_opt(path):
    current_state = path[-1]
    total = 0
    for i in range(len(current_state)):
        for j in range(len(current_state[i])):
            total = total + abs(is_goal.PUZZLE_GOAL[i][j] - current_state[i][j])
    return total


def sudoku_opt(path):
    starting_point = [Sucessors.choose_best_subsquare(path[-1]), Sucessors.choose_best_rows(path[-1]),
                      Sucessors.choose_best_column(path[-1])]
    return max(starting_point, key=lambda w: w[2])[-1]


def queens_opt(path):
    pass