. . , AND (& &), - false, , , OR (||), - true, .
private bool checkMate(ref int numberOfPlies, ref ChessPosition position, int maxNumberOfPlies, List<Move> moves)
{
if (numberOfPlies > maxNumberOfPlies)
return false;
position.makeMove(moves[numberOfPlies]);
if (!(position.getSuccessOfLastMove())))
return false;
numberOfPlies++;
return ((
((isCheckMate()) ||
((checkMate(ref numberOfPlies, ref position, maxNumberOfPlies, moves)))
));
}
, , . - , makeMove() , getSuccessOfLastMove() , , . - . Ply - (Move = , Ply = White Black ). isCheckMate , .
checkMate, isCheckMate() , , ||.
:
//...
bool isThisFlowerYellowOrYellowish ( )
{ return ((( .flowerColor == flower.yellow) (flower.FlowerColor == flower.yellowish)) (Flower.setColorToYellowIfTheColorIsYellowish()));
}
//...
#, , OR #.
setColorToYellowIfTheCollorIsYellowish(), , , OR, , . , .
bool isThisFlowerYellowOrYellowish(Flower flower)
{
if (flower.FlowerColor == flower.yellowish)
return flower.setColorToYellowIfTheColorIsYellowish();
return (flower.flowerColor == flower.yellow);
}
//...
, . "OR" "AND", , , , , , .
-, "", , ! .
-, !, ||, & &, | , . #, .
EDIT:
, , , , , .