Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
'for loop' exit at first passage
-
@stephen Thanks for the translation.
-
@stephen and your code runs without errors ! Have you made some change other than translate ?
-
@mibradoc it was like I said, a problem of indentation of you loop on colonne!
-
@cvp I think the errors occurs in line 147, after the loop. This cannot prevent the loop from executing three times.
-
@mibradoc the problem in your original code is that the loop on colonne was in the loop On numéro and this crashed in the first occurrence in loop.
If you indent left the colonne loop, there is no crash...Your code
for numéro... ... For colonne..
correction
for numéro... ... for colonne...
-
@cvp OK, I'll check indentation
-
See my previous post, edited
-
@cvp Great, It'works. Merci les amis ;-)
-
I CHANGED:
for colonne in range((numero_carre % 3)*3,(numero_carre % 3)*3 + 3) :
#colonnes_possibles=[] ⇒ colonnes_possibles=[]for numero_carre in range ( (numcarre_altex // 3) * 3,((numcarre_altex//3)*3) + 3 ) : print (numero_carre) # BUG !! sortie de la boucle for après le 1er passage !! #if numero_carre != numcarre_altex and key[0] not in carrint(numero_carre) : #numero_carre_sans_chiffre = numero_carre colonnes_possibles=[] for colonne in range((numero_carre % 3)*3,(numero_carre % 3)*3 + 3) : if puzzle[ ligne_a_analyser , colonne ] == 0 and key[0] not in puzzle[:9,colonne]: colonnes_possibles.append(colonne) if len(colonnes_possibles) == 1 : fn_remplir_case ( ligne_a_analyser , colonnes_possibles[0] , key[0] ) #print() #print (puzzle) #print ()
-
@stephen All is fine now, thank you.