Python Forum
Python chess game to detect winner
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python chess game to detect winner
#2
Well, the first problem is that the king is never killed in chess. The game ends the turn before before that.

That said, this might work for you.
for elem in self.destroyed_pieces:
    if elem == "bk.png":
        messagebox.showinfo("White Wins")
    if elem == "wk.png":
        messagebox.showinfo("Black Wins")
Reply


Messages In This Thread
Python chess game to detect winner - by ddddd - Dec-13-2020, 04:42 PM
RE: Python chess game to detect winner - by michael1789 - Dec-13-2020, 10:24 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  a chess endgame problem, almost solved but not quite max22 0 190 Mar-31-2024, 06:14 PM
Last Post: max22
  optimum chess endgame with D=3 pieces doesn't give an exact moves_to_mate variable max22 1 308 Mar-21-2024, 09:31 PM
Last Post: max22
  strange behavior of chess library in Python max22 1 364 Jan-18-2024, 06:35 PM
Last Post: deanhystad
  When does Python detect Errors? stamp1t 1 474 Oct-21-2023, 05:53 PM
Last Post: deanhystad
  How to detect abnormal data in big database python vanphuht91 5 1,185 Jun-27-2023, 11:22 PM
Last Post: Skaperen
  How to detect the text above lines using OpenCV in Python pframe 0 2,537 Apr-14-2020, 09:53 AM
Last Post: pframe
  Detect finger clicks/snaps using Python fwinter102 0 2,065 Aug-12-2019, 04:02 PM
Last Post: fwinter102
  Does Python sqlite3 detect connection errors zatlas1 6 4,060 Jan-18-2019, 06:02 AM
Last Post: zatlas1
  How to detect wireless modem connected serially to my laptop in python barry76 3 3,590 Jan-08-2019, 06:18 AM
Last Post: Gribouillis
  Is there a way to detect the text font, size and color from an image in python? Maia07 2 8,735 Aug-23-2018, 01:16 PM
Last Post: Maia07

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020