Mike Nelson wrote on Tue, Oct 22, 2002 01:39 AM UTC:
Nuno,
Try giving each Bishop three piece attributes moved?, must-convert? and
cant-convert?, all set initially to false.
When attempting to move a Bishop, check the attributes of that Bishop.
If all three attributes are false, neither Bishop has moved. Choose a
normal move or a conversion and look for the other Bishop on its starting
square (it will be there unless it has been captured) and if you choose a
normal move set the other Bishop's must-convert? to true, if you choose a
conversion, set the other Bishop's cant-convert? to true. Set the first
Bishop's moved? to true.
When checking the Bishop to be moved, if moved? is true, the Bishop has
moved before and only normal moves are allowed. If moved? is false, and
the other Bishop has moved, exactly one of must-convert? and cant-convert?
will be true. Choose the appropriate move and set the Bishop's moved? to
true.