@MercantileCircle said in #16:
> On
Lichess.org, the message “The study may contain illegal positions” means that one or more positions within the study could not be reached legally in a chess game that follows the normal rules of the game.
>
> What can cause this?
> Here are some common causes:
>
> Manual editing of positions: If someone uses the “FEN” button or the board editor to manually place pieces, they can create a position that cannot be achieved in a legal game (e.g., two kings in check, a pawn on the first row, too many pieces of the same type, etc.).
>
> Errors when loading FEN or PGN: A poorly generated FEN or a PGN game that has errors can cause illegal positions.
>
> Backtracking in the study without corrections: If previous moves are deleted or the move history is changed without correctly adjusting the position, this can leave the final position in an “illegal” state.
>
> Problems with chess logic: Such as having a pawn on row 1 or 8 without having promoted it, a king in check without it being the opponent's turn, etc.
>
> How to fix it?
> Review each chapter or position in the study.
>
> Click on the tools icon (usually at the top or side of the editor).
>
> Use the “Board Editor” option to check if the position is legal.
>
> You can also copy the FEN of the position and verify it with another engine or online FEN editor.
>
> Remove or correct illegal positions manually.
AI written, also it makes no sense we know its illegal we are saying it shouldn't allow it, not how to keep only legal positions