コード例 #1
0
void cmd_inspect(char *s)
{
    int i;
  
    output("\tPawns : ");
    output("W : "); 
    for (i=1;i<9;i++) output("%d",board->pawns[0][i]);
    output(" B : ");
    for (i=1;i<9;i++) output("%d",board->pawns[1][i]);
    output("\n");

    output("\tFlags : %s\n", formatflags());

    if (ply)
    {
	undo u = undostack[ply-1];
	int v = board->flags;
      
	board->flags = u.flags;
	output("\tprevious move : %c took %c = %s : %s\n",
	       rep(u.moved), rep(u.captured), movestring(u.m), formatflags());
	board->flags = v;
    }
  
    if (fullincheckp(tomove()))
    {
	output("\tYou are currently in check : %d\n", fullincheckp(tomove()));
    }
}
コード例 #2
0
void printboard_and_time()
{
    int full, part;
    
    printboard();
    
    printf("W %s\t", formattime(chessclock[WHITE]));
    printf("B %s\n", formattime(chessclock[BLACK]));

    full = fullincheckp(tomove());
    part = ply ? incheckp(tomove()) : 0;
    
    if (full)
	printf("In Check : %d\n", full);

    if ((part &&  !full)||(full && !part))
    {
	printf("partial checktest (%d) and full checktest (%d) do no agree\n",
	       part, full);
    }
    
    printf("%c To Move\n", (tomove()==WHITE) ? 'W' : 'B');
}