Link to home
Start Free TrialLog in
Avatar of James Hancock
James HancockFlag for United States of America

asked on

Any Python chess GUI suggestions?

Hi
My invulnerable :) chess AI is going to be done, but I'd appreciate some pointers on a chess GUI in Python
I have a legal-move generator coming on nicely, I have pyGame.
Right now, I am printf'ing the board state to the Pycharm console, list of lists, White upper case and black lower case characters, init'ed like this:
It is legible in the fixed width font printout method below, but in array format - a GUI would ease the pain.
self.board = [[' ',' ',' ',' ',' ',' ',' ',' '] for i in range(8)]


        self.board[0] = ['R', 'N', 'B', 'Q', 'K', 'B', 'N', 'R']
        self.board[1] = ['P', 'P', 'P', 'P', 'P', 'P', 'P', 'P']
        self.board[7] = ['r', 'n', 'b', 'q', 'k', 'b', 'n', 'r']
        self.board[6] = ['p', 'p', 'p', 'p', 'p', 'p', 'p', 'p']

Open in new window


This is my ChessBoard class's print method...
    def print(self):

        for i in range(7,-1,-1):
            print(i, '>', self.board[i])

Open in new window



What might the best GUI approach be?
Would I need transparent pieces over my own board GUI, to do select and drag and drop movements w a mouse?

Thanks
Avatar of James Hancock
James Hancock
Flag of United States of America image

ASKER

I found this page of transparent GIF's

here
ASKER CERTIFIED SOLUTION
Avatar of James Hancock
James Hancock
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks