On 03/14/2013 07:23 PM, Matthew Ngaha wrote:
              if Enemy.ships:
                  for missile in self.missiles:

                        flag = False

                      for rect in Enemy.rects:

                            assert(!flag)

                          if QPoint(missile.x + 5, missile.y) in rect:
                              explosion = Explosion(rect.x(), rect.y())
                              self.explosions.append(explosion)

                                flag = True

                              break

im about to try the suggestions. i on python 3 and this line is giving
me a syntax error assert(!flag).



My mistake.  The exclamation point is from C.  In Python, it should be "not"

assert(not flag)

This statement simply asserts (claims) that flag is NOT TRUE, and if for some reason it is true, it throws an exception.

--
DaveA
_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to