10284 - Chessboard in FEN


Difficulty : easy

Solution Description :

Chess Game Ad hoc problem

Simple move of chess board pieces

1. For Black pawn (x,y) -> two attacking position (x+1,y-1) and (x+1,y+1)
2. For White Pawn (x,y) -> two attacking position (x-1,y-1) and (x-1,y+1)
3. For Black and White King (x,y) -> 8 attacking position (x-1,y-1), (x-1,y), (x-1,y+1), (x,y-1), (x,y+1), (x+1,y-1), (x+1,y), and (x+1,y+1).
4. For Black and White Knight(x,y)-> 8 attacking position (x-1,y-2), (x-2,y-1), (x-2,y+1), (x-1,y+2), (x+1,y+2), (x+2,y+1), (x+2,y-1), and (x+1,y-2)
5. For Black and White Bishop -> attacking position move diagonally until break by the other pieces.
6. For Black and White Rock -> attacking position move horizontally and vertically until break by the other pieces.
7. For Black and White Queen -> attacking position move diagonally, horizontally and vertically until break by the other pieces.

Do not forgot about out of boundary, out of boundary is a illegal attacking position for all pieces.