When capturing a piece, pawns move forward diagonally to the left or right one square. These are the only valid moves considered for this problem. When a chess piece is moved to a square that contains one of the opponent's pieces, the opponent's piece is captured and removed from the board. A move is represented by a four character string containing the starting square and then the destination square. In magnetic chess, every piece has a charge that generates a magnetic field, except the two Kings which have a neutral charge.
White pieces have positive charge and black pieces are negatively charged.
A King isn't repelled or attracted and has a blocking effect on the magnetic field lines. In magnetic chess, a White Pawn can move forward 1 or 2 squares when it is on the 1st row and a Black Pawn can move forward 1 or 2 squares when it is on the 8th row. Consider the following move by a White Queen of f4f5 on a simple board configuration. The Black Rook at square h5 is pulled to position g5 . The White King blocks any movement of the Black Bishop on f8 .