Add check, checkmate, stalemate detection and FEN export functions #6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds new functions to the API in mcu-max.h and implements them in mcu-max.c.
mcumax_is_in_check(uint8_t side): Checks if the king of the given side is in check.
mcumax_is_in_checkmate(uint8_t side): Checks if the king of the given side is in checkmate.
mcumax_is_stalemate(uint8_t side): Checks if the king of the given side is in stalemate.
mcumax_get_fen(char* fen_buffer, size_t buffer_size): Exports the current position in FEN format.
These additions improve the engine’s ability to detect game-ending conditions and export the board state for interoperability.
All functions are declared in mcu-max.h and fully implemented in mcu-max.c