flip Side
Creates a new Position identical to the current one, but with the active side toggled.
This method is used to pass the turn to the opponent without making a move on the board.
Constraint: The turn cannot be flipped if the current side is in check or checkmate. Flipping the turn in such a state would result in an illegal position (a state where the king could be captured), which is not permitted by this library logic.
Return
A new Position instance with whiteMove toggled.
Since
v1.0.0-beta.7
Throws
If the current position is in check or checkmate.