I am writing code for a project in school and am trying to recreate Tron in Python. I have code that inserts the bikes current position into a list named self.body2 and then compare it to the current position of the other bike named self.pos . Through error testing I managed to figure out that the problem is probably in the second if statement because self.pos and x are updating properly but the program never prints "yes".
Any help would be appreciated! Thanks
(Some code from my project)
for x in self.body2: print(x) if self.pos == x: print("yes")
Aucun commentaire:
Enregistrer un commentaire