def destroy_piece(self, piece): """ Removes piece from the canvans and click-handler automatily called by move_piece """ img1=piece.get_img_int(0) img2=piece.get_img_int(1) del self._on_clicks[str(img1)] del self._on_clicks[str(img2)] self.delete(piece.get_img_int(0)) self.delete(piece.get_img_int(1)) self.destroyed_pieces = [] self.destroyed_pieces.append(piece) for elem in self.destroyed_pieces: if elem in self.destroyed_pieces == "bk.png" or "wk.png": messagebox.showinfo("WINNER") print (self.destroyed_pieces)So I am trying to write out a message when the king has been killed by adding all destroyed pieces and when the king is in the list the winner gets announced, however it is not working,
buran write Dec-13-2020, 06:27 PM:
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.