|
|
|
@ -90,7 +90,7 @@ bool logic::isChessman( const char ChessmanPtr )
|
|
|
|
|
///////////////////////////////////////
|
|
|
|
|
void logic::clearBoard( void )
|
|
|
|
|
{
|
|
|
|
|
for( register int tmp = 0; tmp < 64; tmp++ )
|
|
|
|
|
for( int tmp = 0; tmp < 64; tmp++ )
|
|
|
|
|
{
|
|
|
|
|
chessman[tmp].Type = Null;
|
|
|
|
|
current[tmp].ManPtr = Null;
|
|
|
|
@ -120,7 +120,7 @@ void logic::Init( const int Var )
|
|
|
|
|
///////////////////////////////////////
|
|
|
|
|
void logic::Init_Standard( void )
|
|
|
|
|
{
|
|
|
|
|
register int tmp;
|
|
|
|
|
int tmp;
|
|
|
|
|
|
|
|
|
|
clearBoard();
|
|
|
|
|
for( tmp = 0; tmp < 32; tmp++ )
|
|
|
|
@ -394,7 +394,7 @@ void logic::writeSAN( void )
|
|
|
|
|
Position backup[64];
|
|
|
|
|
bool SANambig(FALSE);
|
|
|
|
|
bool SANambig2(FALSE);
|
|
|
|
|
register char tmp, manPtr, toPtr, fromPtr;
|
|
|
|
|
char tmp, manPtr, toPtr, fromPtr;
|
|
|
|
|
TQString SAN;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
@ -528,7 +528,7 @@ void logic::writeSAN( void )
|
|
|
|
|
TQString logic::board( void )
|
|
|
|
|
{
|
|
|
|
|
TQString output;
|
|
|
|
|
register int tmp(0), tmpMan(0), cR(7), cF(0);
|
|
|
|
|
int tmp(0), tmpMan(0), cR(7), cF(0);
|
|
|
|
|
|
|
|
|
|
while( tmp != 64 )
|
|
|
|
|
{
|
|
|
|
@ -697,7 +697,7 @@ void logic::setBoard( const TQString &board, const short ppf )
|
|
|
|
|
///////////////////////////////////////
|
|
|
|
|
int logic::getKing( const bool Army )
|
|
|
|
|
{
|
|
|
|
|
register int tmp;
|
|
|
|
|
int tmp;
|
|
|
|
|
for( tmp = 0; tmp < 64; tmp++ )
|
|
|
|
|
{
|
|
|
|
|
if( ( chessman[tmp].Army == Army ) && ( chessman[tmp].Type == King ) )
|
|
|
|
@ -715,7 +715,7 @@ int logic::getKing( const bool Army )
|
|
|
|
|
///////////////////////////////////////
|
|
|
|
|
bool logic::isCheck( const bool Army )
|
|
|
|
|
{
|
|
|
|
|
register char tmp(0), currentKing( getKing(Army) );
|
|
|
|
|
char tmp(0), currentKing( getKing(Army) );
|
|
|
|
|
|
|
|
|
|
for( tmp = 0; tmp < 64; tmp++ )
|
|
|
|
|
{
|
|
|
|
@ -735,7 +735,7 @@ bool logic::isCheck( const bool Army )
|
|
|
|
|
///////////////////////////////////////
|
|
|
|
|
bool logic::isLegal( const bool Army )
|
|
|
|
|
{
|
|
|
|
|
register int tmp(0), tmp2(0), count(0);
|
|
|
|
|
int tmp(0), tmp2(0), count(0);
|
|
|
|
|
|
|
|
|
|
for( tmp2 = 0; tmp2 < 64; tmp2++ )
|
|
|
|
|
{
|
|
|
|
@ -1046,7 +1046,7 @@ void logic::HashLegal( const char Man, const bool Recursion )
|
|
|
|
|
void logic::_HashLegal( const bool Recursion )
|
|
|
|
|
{
|
|
|
|
|
/* Used for loops and positions */
|
|
|
|
|
register int Ptr(0), tmp(0), tmp2(0);
|
|
|
|
|
int Ptr(0), tmp(0), tmp2(0);
|
|
|
|
|
|
|
|
|
|
/* Used to calculate a position relative to a given position */
|
|
|
|
|
int dirF(0), dirR(0);
|
|
|
|
|