1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
checker::checker()
{
int bcount=black_count;
int wcount=white_count;
black.pcolor=BLACK;
white.pcolor=WHITE;
player_turn=WHITE;
int i,j,k;
for(i=0;i<8;i++)
for(j=0;j<8;j++)
board[i][j]=NON;
for(i=0;i<3;i++)
for(j=0;j<4;j++)
{
if(j%2==0)
{
k=2*j+1;
board[i][2*j]=BLACK;
// black.update_stone(i, k,bcount,BLACK);
}
if(j%2!=0)
{
k=2*j+1;
board[i][2*j+1]=BLACK;
// black.update_stone(i, k,bcount,BLACK);
}
}
for(i=4;i<8;i++)
for(j=0;j<4;j++)
{
if(j%2==0)
{
k=2*j;
board[i][k]=WHITE;
// white.update_stone(i,k,wcount,WHITE);
}
if(j%2!=0)
{
k=2*j+1;
board[i][2*j+1]=WHITE;
// white.update_stone(i,k,wcount,WHITE);
}
}
for(i=0;i<8;i++)
if(i%2!=0)
board[3][i]=EMP;
for(i=0;i<8;i++)
if(i%2==0)
board[4][i]=EMP;
};
|