Moderators: hgm, Andres Valverde
int MatingPotential(int n[NR_COLORS][NR_PIECE_TYPES], int side, int myPHCR, int myOldP)
{
int my = side, his = WHITE+BLACK - side;
int majors = 5*n[his][H] + 7*n[his][C] + 7*n[his][R];
myPHCR -= n[my][A] + n[my][E] + myOldP; // discount defenders and old Pawns
if(myPHCR + myOldP == 1) // KA*E*
return n[his][A] == 2 && n[his][H] > 0; // covers the crazy KKHAA positions above
if(myPHCR > 2) return TRUE // if we have no P, H or R here, we must have CC
if(myPHCR == 2 && n[my][C] == 0) return TRUE; // has exactly one H, R or fresh P.
// if we get here, we have either KC... or KP..., with only additional A, E or old P
if(myOldP) // we have old Pawns
return
majors // KPKX
|| n[his][A] && myOldP + n[my][C] + n[his][A] > 2 // KPKAA, KPPKA, and KCPKA
|| n[my][C] && UnpromotedCentralPawn(his); // KCPKP
else // we have KCA*E*
return
n[my][A] // KCAK
|| n[my][E] && n[his][A] + n[his][C] + n[his][R] > 0 // KCEKX (X != H)
|| majors + (12*n[his][A] | 6*n[his][E]) > 16 // KCKAX, KCKEEX, KCKEXX (XX != HH), KCKXXX
|| majors + n[his][A] && UnpromotedCentralPawn(his); // KCKPX
}
if(!MatingPotential(pieceCounts, WHITE, totalW, oldW) &&
!MatingPotential(pieceCounts, BLACK, totalB, oldB) ) GameEnds(DRAW); // theoretical draw
Winboard @XQ.ini -saveSettingsFile"XQ.ini" -SettingsFile"XQ.ini"
Nguyen Pham wrote:I have tried to use Option/Save setting now and/or modify the line /saveSettingsOnExit=false to true in the file xq.init, but all my settings (windows' positions, sizes, on/off panels) will be lost on the next time I run WB.
How can I auto save my settings? Thanks.
PS: Almost all my problems of using WB actually are not really my problems - I can use WB in anyway. However I have reported them here because I have known that normal users are very lazy to report their problems and I hope that WB will be widely used by Asian (usually they are not good at both English and computer) as a standard program for Xiangqi.
Return to WinBoard development and bugfixing
Users browsing this forum: No registered users and 0 guests