Move Generation

A fundamental requirement of your draughts program will be the ability to generate all legal moves given any board position. Our tournament rules state that if your program cannot generate a legal move within the time limit, or if it refuses to accept a legal move, your program will forfeit the game it is playing. It is therefore of paramount importance that you are absolutely certain that your move generation function has no bugs. Should you choose to have some aspect of tree search in your program, it also becomes important that your move generation function be efficient (this will be discussed later).

Things you need to think about:

  • ordinary moves
  • captures
  • en passant captures
  • castling
  • promotions and underpromotions
  • promotions with captures

I recommend that you carefully test move generation in many different scenarios before plunging into search techniques, as it will save you heartache later.