示例#1
0
def recuringSolve(data, currentSol):
    # print('==============')
    # print(data)
    # print(currentSol)
    if len(data) == 0:
        if checkSolution(currentSol):
            displaySolution(currentSol)
        return

    row = data.pop(0)
    for i in range(4):
        # print(i)
        currentSol.append(row)
        recuringSolve(data, currentSol)
        currentSol.pop()
        row = rotate(row)
    data.insert(0, row)
示例#2
0
def recuringSolve(data, currentSol):
    # print('==============')
    # print(data)
    # print(currentSol)
    if len(data) == 0:
        if checkSolution(currentSol):
            displaySolution(currentSol)
        return

    row = data.pop(0)
    for i in range(4):
        # print(i)
        currentSol.append(row)
        recuringSolve(data, currentSol)
        currentSol.pop()
        row = rotate(row)
    data.insert(0, row)
示例#3
0
def solve(data):
    currentSol = [data.pop(0)]
    recuringSolve(data, currentSol)
示例#4
0
def solve(data):
    currentSol = [data.pop(0)]
    recuringSolve(data, currentSol)