H. G. Muller wrote on Sun, Jun 7, 2020 11:30 AM UTC:
Oh sure, that would be very easy as well. An efficient way to representthe board is by an array much larger than the board itself, and surround a board-sized central area by unmovable and uncapturable 'boundary guard' pieces. Then moves that stray off board will be automatically rejected by the code that prevents capture of your own pieces, without having to test whether it ended on the board proper. So all you do is when a brouhaha square is evacuated, not set it to the code for an empty square but to one for a boundary guard. You could do that by replacing the statement board[fromSqr] = 0; in the MakeMove() routine by board[fromSqr] = shadow[fromSqr]; where the 'shadow' array can be initialized to indicate which squares revert to empty, and which to boundary.
Perhaps I should support brouhaha squares in the Interactive Diagram. It already recognizes the special piece type 'hole', which can used to place boundary guards on the board. (Usually as edge fillers to implement non-rectangular boards, such as for Omega Chess.) I could als have it recognizepiece type 'brouhaha', and use that to place hole on the shadow board instead of the regular one.
Oh sure, that would be very easy as well. An efficient way to representthe board is by an array much larger than the board itself, and surround a board-sized central area by unmovable and uncapturable 'boundary guard' pieces. Then moves that stray off board will be automatically rejected by the code that prevents capture of your own pieces, without having to test whether it ended on the board proper. So all you do is when a brouhaha square is evacuated, not set it to the code for an empty square but to one for a boundary guard. You could do that by replacing the statement board[fromSqr] = 0; in the MakeMove() routine by board[fromSqr] = shadow[fromSqr]; where the 'shadow' array can be initialized to indicate which squares revert to empty, and which to boundary.
Perhaps I should support brouhaha squares in the Interactive Diagram. It already recognizes the special piece type 'hole', which can used to place boundary guards on the board. (Usually as edge fillers to implement non-rectangular boards, such as for Omega Chess.) I could als have it recognizepiece type 'brouhaha', and use that to place hole on the shadow board instead of the regular one.