Bonjour a tous,
Je me tourne vers vous car étant en terminale scientifique option ISN ( Informatique et science du numérique ), et dans le cadre de mon projet final pour le bac, j'ai choisi pour thème un programme proposant une résolution du rubik's cube, une interface graphique du cube (3*3*3) puis les différents stades de résolution.
J'ai malheureusement fait mon programme sous python 2 et mon professeur m'a récemment informé que le projet devra être rendu et présenté sous python 3.
Et la le drame mon programme de résolution de la seconde couronne ne fonctionne plus du tout et semble se faire de manière totalement aléatoire.
J'ai tout transcrit en python 3 mais pour cette partie du programme je ne trouve pas ( après 3 semaines de recherches ) a quel endroit est le problème , sachant le l'algorithme se déroule parfaitement sous pyton 2.
Je fais donc appel a vous pour me donner si possible des directives quant au problème rencontré ( n'étant qu'un débutant en programmation)
Je vous met ci dessous la partie du programme qui pêche et peux envoyer le programme entier si besoin mais il se fera trop long ici.
Merci d'avance.

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
def solve2ndCouronne(show=1): # Resout la seconde couronne
 
	if show == 1:
		print("\nConstruction de la seconde couronne :\n")
	global uf, ur, ub, ul, df, dr, db, dl, fr, fl, br, bl
	liste = ['rg', 'go', 'ob', 'br'] # Couleurs des aretes par binome, chaque lettre represente une couleur, 'rg' veut dire rouge-vert par exemple
 
	for i in liste: # Cette ligne annonce une boucle, elle signifie "pour chaque element "i" dans la liste "liste"
 
		if fl['f'] in i and fl['l'] in i:
			move("F", show)
			move("U", show)
			move("F'", show)
			move("U'", show)
			move("L'", show)
			move("U'", show)
			move("L", show)
 
		if br['b'] in i and br['r'] in i:
			turnCube(show)
			turnCube(show)
			move("F", show)
			move("U", show)
			move("F'", show)
			move("U'", show)
			move("L'", show)
			move("U'", show)
			move("L", show)
			turnCube(show)
			turnCube(show)
 
		if bl['b'] in i and bl['l'] in i:
			turnCube(show)
			turnCube(show)
			turnCube(show)
			move("F", show)
			move("U", show)
			move("F'", show)
			move("U'", show)
			move("L'", show)
			move("U'", show)
			move("L", show)
			turnCube(show)
 
		if fr['r'] is i[0] and fr['f'] in i:
			move("R", show)
			move("U", show)
			move("R'", show)
			move("U'", show)
			move("U'", show)
			move("R", show)
			move("U'", show)
			move("U'", show)
			move("R'", show)
			move("U", show)
			move("F'", show)
			move("U'", show)
			move("F", show)
 
		if uf['f'] is i[0] and uf['u'] in i:
			move("U", show)
			move("R", show)
			move("U", show)
			move("R'", show)
			move("U'", show)
			move("F'", show)
			move("U'", show)
			move("F", show)
 
		if uf['u'] is i[0] and uf['f'] in i:
			move("U'", show)
			move("R'", show)
			move("U'", show)
			move("R'", show)
			move("U'", show)
			move("R'", show)
			move("U", show)
			move("R", show)
			move("U", show)
			move("R", show)
 
		if ur['u'] is i[0] and ur['r'] in i:
			move("R'", show)
			move("U'", show)
			move("R'", show)
			move("U'", show)
			move("R'", show)
			move("U", show)
			move("R", show)
			move("U", show)
			move("R", show)
 
		if ur['r'] is i[0] and ur['u'] in i:
			move("U", show)
			move("U", show)
			move("R", show)
			move("U", show)
			move("R'", show)
			move("U'", show)
			move("F'", show)
			move("U'", show)
			move("F", show)
 
		if ub['b'] is i[0] and ub['u'] in i:
			move("U'", show)
			move("R", show)
			move("U", show)
			move("R'", show)
			move("U'", show)
			move("F'", show)
			move("U'", show)
			move("F", show)
 
		if ub['u'] is i[0] and ub['b'] in i:
			move("U", show)
			move("R'", show)
			move("U'", show)
			move("R'", show)
			move("U'", show)
			move("R'", show)
			move("U", show)
			move("R", show)
			move("U", show)
			move("R", show)
 
		if ul['l'] is i[0] and ul['u'] in i:
			move("R", show)
			move("U", show)
			move("R'", show)
			move("U'", show)
			move("F'", show)
			move("U'", show)
			move("F", show)
 
		if ul['u'] is i[0] and ul['l'] in i:
			move("U", show)
			move("U", show)
			move("R'", show)
			move("U'", show)
			move("R'", show)
			move("U'", show)
			move("R'", show)
			move("U", show)
			move("R", show)
			move("U", show)
			move("R", show)
 
		if fr['f'] is i[0] and fr['r'] in i and show == 1:
			print("Arete bien mise !")