Are There 65,884 Legal Chess Moves?

I’ve finished creating the global move list.  This list contains all legal chess moves (e.g. one move might be white bishop on g2 captures black queen on d5).  It would seem there are 65,884 possible legal moves!  Does anyone know if this is indeed correct?

EDIT: It looks like my first attempt was off.  After more debugging I have 43,764 possible moves!

  • Fred

    for me, in my engine, i count 16,692 valid moves. My definition of valid move is, for each piece on each square on an empty board, what is valid. I’m not using bitboard but array and bitwise operation, a kind of mix. my “valid move” dictionary is a jagged array of boolean of (from)(to)(piece), i’m using 0x88 board.

    so i know that (A1)(B1)(rook) is valid and (A1)(B2)(rook) is invalid

    another dictionary(of integer) that i have is (from)(piece)(to) to get a list of possible move (this one also have 16,692 moves)

    so (A1)(rook) will give me; B1 to H1 and A2 to A8

    when i actually do a real move, i do check that it is a valid move by making sure there is no piece between from and to and so on

    if you want i could give you an “export” if mine in text format

    • Steve Maughan

      Hi Fred – my definition of a move is a little more exact. R on a1 to b1 is one move, R take knight on b1 is another and R takes bishop on b1 is another. This will account for the difference!

  • Fred

    do you put that in a “dictionary” for later use or it’s just to count what is available on the current board(specific FEN)?

    • Steve Maughan

      I plan to use it to record generated moves. So to record a possible move I just need to store a pointer to that move.