def main(): global repetidos repetidos = {} global dis dis = {} dir = [[1, 3], [-1, 1, 3], [-1, 3], [-3, 1, 3], [-3, -1, 1, 3], [-3, -1, 3], [-3, 1], [-3, -1, 1], [-3, -1]] game = [0] * 9 over = [0] * 9 tabGame = AuxFunctions.buildGame(game) repetidos[tabGame] = 0 tabOver = AuxFunctions.buildGame(over) if AuxFunctions.isSolvable(tabGame, tabOver): print solveDFS(game, over, dir) else: print "Nao e resolvivel"
def main(): global repetidos repetidos = {} global dis dis = {} global caminho caminho = {} dir = [[1, 3], [-1, 1, 3], [-1, 3], [-3, 1, 3], [-3, -1, 1, 3], [-3, -1, 3], [-3, 1], [-3, -1, 1], [-3, -1]] game = [0] * 9 over = [0] * 9 tabGame = AuxFunctions.buildGame(game) tabOver = AuxFunctions.buildGame(over) if AuxFunctions.isSolvable(tabGame, tabOver): solveGreedy(game, over, dir) jogadas = AuxFunctions.printCaminho(caminho, tabGame, tabOver) print "Encontrada solucao em", jogadas, "jogadas." else: print "Nao e resolvivel"
def main(): global repetidos repetidos = {} global caminho caminho = {} global dis dis = {} dir = [[1,3], [-1, 1, 3], [-1,3], [-3, 1, 3], [-3, -1, 1, 3], [-3, -1, 3], [-3, 1], [-3, -1, 1], [-3, -1]] game = [0]*9 over = [0]*9 tabGame = AuxFunctions.buildGame(game) caminho[tabGame] = tabGame tabOver = AuxFunctions.buildGame(over) if AuxFunctions.isSolvable(tabGame, tabOver): print solveIDFS(tabGame, tabOver, dir) jogadas = AuxFunctions.printCaminho(caminho, tabGame, tabOver) else: print "Nao e resolvivel"