Adding pieces on the board
We now have a code that converts the FEN notation to its expanded coordinate-based representation. Now, let's code to actually display chess pieces on the board, based on a given FEN notation, as shown in the following screenshot:
Prepare for Lift Off
We will use PNG images for displaying pieces on the board. We have provided PNG images for each piece in a folder named
pieces_image. The images have been named by appending the shortname of each piece followed by the color of the piece. For instance, black queen is saved as
qblack.png, and white knight is saved as
We have chosen PNG over GIF because unlike GIF, ...