bool ClearPair()
{
//读出棋盘数据
updataChess();
//遍历整个棋盘,找相同类型 一对棋子
POINT p1,p2
int x1,y2,x2,y2;
for(y1=0;y1<11;y1++)
for(x1=0;x1<19;x1++)
for(y2=0;y2<11;y2++)
for(x2=0;x2<19;x2++)
if((chessdata[y1][x1]==chessdata[y2][x2])&&(!((x1==x2)&&(y1=y2))))//数值相等 且不是同一个
{
p1.x=x1;p1.y=y1;
p2.x=x2;p2.y=y2;
//检测 相同的2个棋子是否可以消掉
if(CheckLine(p1,p2))
{
clik2p(p1,p2);
return true;
}
}
return false;
}
posted on 2011-01-31 20:21  °ι 、曲 终  阅读(543)  评论(0编辑  收藏  举报