Skip to main content
added 125 characters in body
Source Link
chux
  • 36.4k
  • 2
  • 43
  • 97

StateFEN lacks info indicating the last time a piece taken or pawn advanced.

StateFEN lacks info needed for check of the possible outcomes repeating 3 times.

The king is not in check before castlingwhen attempting to castle.

What if the side lacks a legal move?
What isif the FEN state is invalid due to position? (castling flag OK yet no rook, en pass with no pawn, white to move yet no piece.)
How much error checking is desired?

Non-standard board support

Hmm, with more than 2 rooks, 1 king, I see a need for more than 2 castling flags.

State lacks info indicating the last time a piece taken or pawn advanced.

State lacks info needed for check of the possible outcomes repeating 3 times.

The king is not in check before castling.

What if the side lacks a legal move?
What is the FEN state is invalid due to position? (castling flag OK yet no rook, en pass with no pawn, white to move yet no piece.)
How much error checking is desired?

FEN lacks info indicating the last time a piece taken or pawn advanced.

FEN lacks info needed for check of the possible outcomes repeating 3 times.

The king is not in check when attempting to castle.

What if the side lacks a legal move?
What if the FEN state is invalid due to position? (castling flag OK yet no rook, en pass with no pawn, white to move yet no piece.)
How much error checking is desired?

Non-standard board support

Hmm, with more than 2 rooks, 1 king, I see a need for more than 2 castling flags.

added 232 characters in body
Source Link
chux
  • 36.4k
  • 2
  • 43
  • 97

*Speed vs. spaceSpeed vs. space

Do not assume smaller memory footprint is faster - often it is the other way around.

In general, use minimal width objects when an array of them is needed. Otherwise use int, unsigned, double and then wider as needed.

*Speed vs. space

Speed vs. space

Do not assume smaller memory footprint is faster - often it is the other way around.

In general, use minimal width objects when an array of them is needed. Otherwise use int, unsigned, double and then wider as needed.

added 175 characters in body
Source Link
chux
  • 36.4k
  • 2
  • 43
  • 97

*Speed vs. space

For a balance of speed vs. space, consider dropping the bit dibbling of castling, en passant and use struct members. Yet use uint8_t board[64].

short?

short?

*Speed vs. space

For a balance of speed vs. space, consider dropping the bit dibbling of castling, en passant and use struct members. Yet use uint8_t board[64].

short?

added 164 characters in body
Source Link
chux
  • 36.4k
  • 2
  • 43
  • 97
Loading
added 164 characters in body
Source Link
chux
  • 36.4k
  • 2
  • 43
  • 97
Loading
added 164 characters in body
Source Link
chux
  • 36.4k
  • 2
  • 43
  • 97
Loading
deleted 3 characters in body
Source Link
chux
  • 36.4k
  • 2
  • 43
  • 97
Loading
deleted 3 characters in body
Source Link
chux
  • 36.4k
  • 2
  • 43
  • 97
Loading
added 86 characters in body
Source Link
chux
  • 36.4k
  • 2
  • 43
  • 97
Loading
Source Link
chux
  • 36.4k
  • 2
  • 43
  • 97
Loading