| if (max_computer >
max_player) {
x = xc;
y = yc;
} else {
x = xp;
y = yp;
}
// 绘制棋子
num = y * 15 + x;
removeMovieClip(_root.b add num);
duplicateMovieClip(_root.white, "white"
add num, num + 300);
setProperty(_root.white add num, _x, 34.7 +
x * 20);
setProperty(_root.white add num, _y, 34.7 +
y * 20);
_root.table[y][x] = 2;
// 显示棋子
_root.display = "Xpos : " + (x +
1);
temp = chr ( y + 65);
_root.display1 = "Ypos : " + temp;
_root.playnow = "player";
// 判断是否获胜
xx = x;
yy = y;
for (k=0; k<4; k++) {
if (_root.a_result <> 6) {
_root.a_result = 0;
x = xx;
y = yy;
while ((_root.table[y][x] == 2) and (y+_root.dir[k][1]
< 16) and (x+_root.dir[k][0] >= -1) and
(x+_root.dir[k][0] < 16) and (y+_root.dir[k][1]
>= -1)) {
x = x + _root.dir[k][0];
y = y + _root.dir[k][1];
// "_root.table["+y+"]["+x+"]="+_root.table[y][x]
_root.a_result = _root.a_result+1;
}
x = xx;
y = yy;
while ((_root.table[y][x] == 2) and (y+_root.dir[k+4][1]
< 16) and (x+_root.dir[k+4][0] >= -1)
and (x+_root.dir[k+4][0] < 16) and (y+_root.dir[k+4][1]
>= -1)) {
x = x + _root.dir[k+4][0];
y = y + _root.dir[k+4][1];
_root.a_result = _root.a_result+1;
}
|