user25645: Starting from the standard initial position, how many possible legal chess moves are there in this and all possible following positions?
Say, ignoring the starting position, a bishop can move to 32 squares (but the other covers the other 32), a rook to 64, if both sides are taken into account, pawns can also reach all 64 squares, a knight, king and queen can also reach all 64 positions.
So in sum, that should be 384 total move target-square+piece combinations. Is this correct?
But what is the number of moves if the starting position is not ignored?
Then, 16 pawn double-step advances have to be added, plus 4 castling moves (2, queen and kingside for each player). And en passant , which should be 7 left and 7 right, times 2 for both players. And all possible source-target square combinations of all other pieces!

user25645: If the board is given and only the source and target square, as well the promotion choice are considered (as in the UCI format), then it appears there will be 1968 possible moves.
# Python
# pip install python-chess
import chess

moves = 0

# Queen, covers all lines and diagonals
for x in range(8):
    for y in range(8):
        board = chess.Board("8/8/8/8/8/8/8/8")
        board.set_piece_at(chess.square(x,y), chess.Piece(chess.QUEEN, chess.WHITE))
        moves += len(list(board.generate_legal_moves()))
        
# Knight jumps
for x in range(8):
    for y in range(8):
        board = chess.Board("8/8/8/8/8/8/8/8")
        board.set_piece_at(chess.square(x,y), chess.Piece(chess.KNIGHT, chess.WHITE))
        moves += len(list(board.generate_legal_moves()))
        
        
# Straight pawn promotions, 2 players, 8 ranks each, 4 choices (queen, rook, bishop, knight)
moves += 2*8*4

# Diagonal pawn promotions, when capturing a piece
# 2 players, 14 diagonals (12 in the center and 1 each in the first and last ranks), 4 choices
moves += 2*14*4
        
print(moves)

Castling is assumed to be indicated by moving the king two steps.
Here are all possible UCI strings and here is the code to generate them.

user4149: The white king can move to 8 fields from the inner 36 fields, to 4 fields from the 4 corner fields and to 5 fields from the remaining 24 boundary fields. That's 420 moves for the white king, add 2 for castlings to arrive at 422. If you distinguish captures, this almost doubles (castling can't capture) to 842. Now allow for the black king to double this (1684)? Or identify moves they could both make (i.e., all but castling - 844)?
A rook can always (given free line of sight) move to 14 squares. That's 896 moves. Double to 1792 if you distinguish captures. Double again (3584) if you want to distinguish colour.
On a diagonal (NW to SE, say) of length n, a bishop can make n(n-1) moves (pick a start field and a distinct end field). Sum over n=1,2,3,4,5,6,7,8,7,6,5,4,3,2,1 (i.e., ignoring the colour of the bishop) to arrive at 280 moves, double to 560 to count both diagonal directions. Double (1120) if you want to distinguish captures, double once more (2240) if you want to distinguish by colour.
For the queen simply add rook and bishop, thus counting 1456, 2912, or 5824 moves.
The knight can typically make 8 moves, but as with the king we have to account for nearby boundary. It is easier to count by direction: There are 42 (6 by 7) fields from where we can go two to the right and one up, say. We have the same number 42 (though with different fields) for all eight directions, hence a total of 336 knight moves. Double (672) if you distinguish captures. Double again (1344) if you distinguish by colour.
A white pawn can move two fields ahead from its initial position (8 moves). It can move one ahead from rows 2 to 6 (40 moves). It can move ahead from row 7 and promote to queen, rook, bishop, or knight (32 moves). For pawns, we must distinguish captures: In only seven of the eight columns, we can capture to the right, and in seven of eight columns we can capture to the left. This gives us 70 capture moves from rows 2 to 6, plus 56 capture with promotion. So far 206. If you want to distinguish capture en passant from a normal capture by the same movement (start and end field) of the pawn, add 14 to arrive at 220. Again, at least for pawns it seems useful to distinguish by player and arrive at 440.
In summary, the most generous way of counting possible moves might lead to 1684  + 3584 + 2240 + 5824 + 1344 + 440 = 15116 distinct moves. One could raise the number even higher by distinguishing moves that give check or even checkmate, or by distinguishing captures according to the piece captured.

25645: <p>Starting from the standard initial position, how many possible legal chess moves are there in this and all possible following positions?</p>
<p>Say, ignoring the starting position, a bishop can move to 32 squares (but the other covers the other 32), a rook to 64, if both sides are taken into account, pawns can also reach all 64 squares, a <a href="https://en.wikipedia.org/wiki/Knight%27s_tour" rel="nofollow noreferrer">knight</a>, king and queen can also reach all 64 positions.</p>
<p>So in sum, that should be 384 total move target-square+piece combinations. Is this correct?</p>
<p>But what is the number of moves if the starting position is not ignored?</p>
<p>Then, 16 pawn double-step advances have to be added, plus 4 castling moves (2, queen and kingside for each player). And en passant , which should be 7 left and 7 right, times 2 for both players. And all possible source-target square combinations of all other pieces!</p>
 25645: <p>If the board is given and only the source and target square, as well the promotion choice are considered (as in the <a href="https://en.wikipedia.org/wiki/Universal_Chess_Interface" rel="nofollow noreferrer">UCI</a> format), then it appears there will be 1968 possible moves.</p>
<pre><code># Python
# pip install python-chess
import chess

moves = 0

# Queen, covers all lines and diagonals
for x in range(8):
    for y in range(8):
        board = chess.Board(&quot;8/8/8/8/8/8/8/8&quot;)
        board.set_piece_at(chess.square(x,y), chess.Piece(chess.QUEEN, chess.WHITE))
        moves += len(list(board.generate_legal_moves()))
        
# Knight jumps
for x in range(8):
    for y in range(8):
        board = chess.Board(&quot;8/8/8/8/8/8/8/8&quot;)
        board.set_piece_at(chess.square(x,y), chess.Piece(chess.KNIGHT, chess.WHITE))
        moves += len(list(board.generate_legal_moves()))
        
        
# Straight pawn promotions, 2 players, 8 ranks each, 4 choices (queen, rook, bishop, knight)
moves += 2*8*4

# Diagonal pawn promotions, when capturing a piece
# 2 players, 14 diagonals (12 in the center and 1 each in the first and last ranks), 4 choices
moves += 2*14*4
        
print(moves)
</code></pre>
<p>Castling is assumed to be indicated by moving the king two steps.</p>
<p><a href="https://gist.github.com/void4/11b1623128c9a97ff461eef81edae665" rel="nofollow noreferrer">Here</a> are all possible UCI strings and <a href="https://gist.github.com/void4/77e1f0aa21ad40622c5634ba03261383" rel="nofollow noreferrer">here</a> is the code to generate them.</p>
 4149: <p>The white king can move to 8 fields from the inner 36 fields, to 4 fields from the 4 corner fields and to 5 fields from the remaining 24 boundary fields. That's 420 moves for the white king, add 2 for castlings to arrive at 422. If you distinguish captures, this almost doubles (castling can't capture) to 842. Now allow for the black king to double this (1684)? Or identify moves they could both make (i.e., all but castling - 844)?</p>
<p>A rook can always (given free line of sight) move to 14 squares. That's 896 moves. Double to 1792 if you distinguish captures. Double again (3584) if you want to distinguish colour.</p>
<p>On a diagonal (NW to SE, say) of length <em>n</em>, a bishop can make <em>n</em>(<em>n</em>-1) moves (pick a start field and a distinct end field). Sum over <em>n</em>=1,2,3,4,5,6,7,8,7,6,5,4,3,2,1 (i.e., ignoring the colour of the bishop) to arrive at 280 moves, double to 560 to count both diagonal directions. Double (1120) if you want to distinguish captures, double once more (2240) if you want to distinguish by colour.</p>
<p>For the queen simply add rook and bishop, thus counting 1456, 2912, or 5824 moves.</p>
<p>The knight can typically make 8 moves, but as with the king we have to account for nearby boundary. It is easier to count by direction: There are 42 (6 by 7) fields from where we can go two to the right and one up, say. We have the same number 42 (though with different fields) for all eight directions, hence a total of 336 knight moves. Double (672) if you distinguish captures. Double again (1344) if you distinguish by colour.</p>
<p>A white pawn can move two fields ahead from its initial position (8 moves). It can move one ahead from rows 2 to 6 (40 moves). It can move ahead from row 7 and promote to queen, rook, bishop, or knight (32 moves). For pawns, we <em>must</em> distinguish captures: In only seven of the eight columns, we can capture to the right, and in seven of eight columns we can capture to the left. This gives us 70 capture moves from rows 2 to 6, plus 56 capture with promotion. So far 206. If you want to distinguish capture en passant from a normal capture by the same movement (start and end field) of the pawn, add 14 to arrive at 220. Again, at least for pawns it seems useful to distinguish by player and arrive at 440.</p>
<p>In summary, the most generous way of counting possible moves might lead to 1684  + 3584 + 2240 + 5824 + 1344 + 440 = <strong>15116</strong> distinct moves. One could raise the number even higher by distinguishing moves that give check or even checkmate, or by distinguishing captures according to the piece captured.</p>
