def sudoku_bestial(n): GC = [[list(range(n))]] for i in range(1,n): support = list(range(n)) support.remove(i) # liste de 0 à n-1 sauf i GN = [] for M in GC: DM = [] for ligne in permutations(support): ligne = [i] + list(ligne) if accepte(M,ligne): DM = DM + [M+[ligne]] GN = GN + DM GC = GN return GC