Defining rules for the chess pieces

Different chess pieces have different rules of movement. Let's try to tabulate the rules:

Name of the chess piece Orthogonal movement Diagonal movement The maximum number of places the chess piece is allowed to move
King Yes Yes 1
Queen Yes Yes 8
Rook Yes No 8
Bishop No Yes 8
Knight N/A N/A N/A
Pawn Yes, but it captures diagonally No 1 or 2

As evident from the table, the rules for all the chess pieces except for Knight and Pawn are pretty straightforward.

Knights are different from the others. They must move two squares in one direction, and then one more move at a 90-degree angle, following the shape of an L. Knights are also the only chess pieces that can jump over other chess pieces. ...

Get Tkinter GUI Application Development Blueprints - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.