void
updategame()
{
if
(judgChess())
{
mciSendString(
"close BGM"
, 0, 0, 0);
mciSendString(
"open 征服2.mp3 alias bgm"
, 0, 0, 0);
mciSendString(
"play bgm repeat"
, 0, 0, 0);
printf
(
"你赢啦!!!"
);
MessageBox(NULL,
"over"
,
"over"
, 0);
exit
(0);
}
}
bool
judgChess()
{
if
(row != -1 && col != -1)
{
int
m = row;
int
n = col;
int
i = 1;
if
(m - 3 > 0 && chess[m][n].used &&
chess[m - i][n].type == chess[m][n].type &&
chess[m - ++i][n].type == chess[m][n].type &&
chess[m - ++i][n].type == chess[m][n].type &&
chess[m - ++i][n].type == chess[m][n].type)
return
true
;
i = 1;
if
(m + 3 < 19 && chess[m][n].used &&
chess[m + i][n].type == chess[m][n].type &&
chess[m + ++i][n].type == chess[m][n].type &&
chess[m + ++i][n].type == chess[m][n].type &&
chess[m + ++i][n].type == chess[m][n].type)
return
true
;
i = 1;
if
(n - 3 > 0 && chess[m][n].used &&
chess[m][n - i].type == chess[m][n].type &&
chess[m][n - ++i].type == chess[m][n].type &&
chess[m][n - ++i].type == chess[m][n].type &&
chess[m][n - ++i].type == chess[m][n].type)
return
true
;
i = 1;
if
(n + 3 < 19 && chess[m][n].used &&
chess[m][n + i].type == chess[m][n].type &&
chess[m][n + ++i].type == chess[m][n].type &&
chess[m][n + ++i].type == chess[m][n].type &&
chess[m][n + ++i].type == chess[m][n].type)
return
true
;
i = 1;
if
(n + 3 < 19 && m + 3 < 19 && chess[m][n].used &&
chess[m + i][n + i].type == chess[m][n].type &&
chess[m + ++i][n + i].type == chess[m][n].type &&
chess[m + ++i][n + i].type == chess[m][n].type &&
chess[m + ++i][n + i].type == chess[m][n].type)
return
true
;
i = 1;
if
(n - 3 > 0 && m - 3 > 0 && chess[m][n].used &&
chess[m - i][n - i].type == chess[m][n].type &&
chess[m - ++i][n - i].type == chess[m][n].type &&
chess[m - ++i][n - i].type == chess[m][n].type &&
chess[m - ++i][n - i].type == chess[m][n].type)
return
true
;
i = 1;
if
(m - 3 > 0 && n + 3 < 19 && chess[m][n].used &&
chess[m - i][n + i].type == chess[m][n].type &&
chess[m - ++i][n + i].type == chess[m][n].type &&
chess[m - ++i][n + i].type == chess[m][n].type &&
chess[m - ++i][n + i].type == chess[m][n].type)
return
true
;
i = 1;
if
(m + 3 < 19 && n - 3 > 0 && chess[m][n].used &&
chess[m + i][n - i].type == chess[m][n].type &&
chess[m + ++i][n - i].type == chess[m][n].type &&
chess[m + ++i][n - i].type == chess[m][n].type &&
chess[m + ++i][n - i].type == chess[m][n].type)
return
true
;
}
return
false
;
}