user25600: I am implementing a chess game. I am aware of the rules but I have not played it much. I need clarification on a small point.
Suppose a player legally moves a piece from square A to square B. Consider the path this piece followed during this move. Can it be different based on the type of piece?
I am not able to find such a case.
Edit :- I am adding the interface code that I am dealing with to make it more clear as asked by some people to give more context.
public class Chess {

    ChessBoard chessBoard;
    Player[] player;
    Player currentPlayer;
    List<Move> movesList;
    GameStatus gameStatus;

    public boolean playerMove(CellPosition fromPosition, CellPositionb toPosition, Piece piece); 
    public boolean endGame();
    private void changeTurn();

}
public abstract class Piece {

Color color;
public boolean validate(CellPosition fromPosition, CellPositionb toPosition);
}

public class Knight extends Piece {
public boolean validate(CellPosition fromPosition, CellPositionb toPosition);

}

Similarly there will be classes for other pieces as Knight. Now if a player want to move in chess from some position X to another position Y, the validate() method of the Piece will be called by playerMove() of chess,validate() can only check whether the move is valid or not.Like for the given pieces,say knight, it will check that from given location,the destination is one of 8 valid moves.For Rook it can be any one of four directions and so on.
The playerMove() function makes a call the the Piece.validate() function and then it gets to know that it is a valid move.The problem that I am trying to address, now once playerMove function in chess, knows that it is valid move, it does not know that whether there is any piece in between from given location to destination?Because the piece dont have context of Board,it cannot detect it thing and it has to be done in playerMove() function of chess.So i will write a code here to generate the list of possible squares that are involved from source to destination. Will that list of squares will always be unique ?or can it be different for diffeent piece? Because apart from knight ,all moves in straight or diagonal so it should be unique ,so I want to clarify on this .If still question not clear, please let me know.but

user15221: The special cases to consider are knight moves, castling, and pawn moves. Knights don't really have a path; you can think of them as teleporting to their destination. Pawns and castling have to follow the same restrictions on moving through occupied squares (they have same squares they "go through" as any other material with the same source and destination squares), but also have additional restrictions. Whenever a king moves other than castling, it doesn't "go through" any squares, so your question doesn't really appy.
Every other move is either a rook move or a bishop move. Whenever a queen moves, it makes either a rook move or a bishop move. When a queen makes a bishop move, it follows the same rules as moving a bishop, and the path it takes is the same as a bishop. When it makes a rook move, it follows the same rules as a rook (other than the aforementioned castling).

user25320: No. It's a matter of taste how the knight travels from the start square to the end square, but nothing is written on how it gets to the final square. The same for castling, of how the rook arrives at the destination square, since it has to get there by moving past the king that's just made a two square move.

user4418: For queens, bishops and rooks moving from square A to square B there is only one way that move can be made and all the squares in between must be empty for that move to be legal.
For a knight moving from square A to square there are generally two ways but that is irrelevant because knights can jump over pieces in the way.
For castling there is only one way the king can move from A to B and the intervening square must be empty for that move to be legal and the king must be moved first. For castling there is only one way the rook can move from A to B and all the squares in between must be empty apart from the king for that move to be legal.

25600: <p>I am implementing a chess game. I am aware of the rules but I have not played it much. I need clarification on a small point.</p>
<p>Suppose a player legally moves a piece from square A to square B. Consider the path this piece followed during this move. Can it be different based on the type of piece?</p>
<p>I am not able to find such a case.</p>
<p>Edit :- I am adding the interface code that I am dealing with to make it more clear as asked by some people to give more context.</p>
<pre><code>public class Chess {

    ChessBoard chessBoard;
    Player[] player;
    Player currentPlayer;
    List&lt;Move&gt; movesList;
    GameStatus gameStatus;

    public boolean playerMove(CellPosition fromPosition, CellPositionb toPosition, Piece piece); 
    public boolean endGame();
    private void changeTurn();

}
public abstract class Piece {

Color color;
public boolean validate(CellPosition fromPosition, CellPositionb toPosition);
}

public class Knight extends Piece {
public boolean validate(CellPosition fromPosition, CellPositionb toPosition);

}
</code></pre>
<p>Similarly there will be classes for other pieces as Knight. Now if a player want to move in chess from some position X to another position Y, the validate() method of the Piece will be called by playerMove() of chess,validate() can only check whether the move is valid or not.Like for the given pieces,say knight, it will check that from given location,the destination is one of 8 valid moves.For Rook it can be any one of four directions and so on.</p>
<p>The playerMove() function makes a call the the Piece.validate() function and then it gets to know that it is a valid move.The problem that I am trying to address, now once playerMove function in chess, knows that it is valid move, it does not know that whether there is any piece in between from given location to destination?Because the piece dont have context of Board,it cannot detect it thing and it has to be done in playerMove() function of chess.So i will write a code here to generate the list of possible squares that are involved from source to destination. Will that list of squares will always be unique ?or can it be different for diffeent piece? Because apart from knight ,all moves in straight or diagonal so it should be unique ,so I want to clarify on this .If still question not clear, please let me know.but</p>
 15221: <p>The special cases to consider are knight moves, castling, and pawn moves. Knights don't really have a path; you can think of them as teleporting to their destination. Pawns and castling have to follow the same restrictions on moving through occupied squares (they have same squares they &quot;go through&quot; as any other material with the same source and destination squares), but also have additional restrictions. Whenever a king moves other than castling, it doesn't &quot;go through&quot; any squares, so your question doesn't really appy.</p>
<p>Every other move is either a rook move or a bishop move. Whenever a queen moves, it makes either a rook move or a bishop move. When a queen makes a bishop move, it follows the same rules as moving a bishop, and the path it takes is the same as a bishop. When it makes a rook move, it follows the same rules as a rook (other than the aforementioned castling).</p>
 25320: <p>No. It's a matter of taste how the knight travels from the start square to the end square, but nothing is written on how it gets to the final square. The same for castling, of how the rook arrives at the destination square, since it has to get there by moving past the king that's just made a two square move.</p>
 4418: <p>For queens, bishops and rooks moving from square A to square B there is only one way that move can be made and all the squares in between must be empty for that move to be legal.</p>
<p>For a knight moving from square A to square there are generally two ways but that is irrelevant because knights can jump over pieces in the way.</p>
<p>For castling there is only one way the king can move from A to B and the intervening square must be empty for that move to be legal and the king must be moved first. For castling there is only one way the rook can move from A to B and all the squares in between must be empty apart from the king for that move to be legal.</p>
