如何用vc++6.0编写2048游戏
# include & ltclimits & gt
# include & ltcstdio & gt
# include & ltcstring & gt
# include & lt堆栈& gt
# include & lt字符串& gt
# include & lt地图& gt
# include & ltvector & gt
# include & ltcmath & gt
使用命名空间std
const int MAXX = 10;
int box[MAXX][MAXX];
void moveLeft(int n,bool & ampret){
for(int I = 0;我& ltn;++i){
for(int j = 0;j & ltn;++j){
int k;
for(k = j-1;k & gt= 0;- k){
如果(框[i][k]!= -1){
打破;
}
}
方框[i][k + 1] =方框[I][j];
if ((k + 1)!= j){
box[I][j]=-1;
ret = true
}
}
}
}
void mergeLeft(int n,bool & ampret){
for(int I = 0;我& ltn;++i){
for(int j = 0;j & ltn-1;++j){
if (box[i][j] == -1)继续;
if(box[I][j]= = box[I][j+1]){
box[I][j]* = 2;
box[I][j+1]=-1;
ret = true
++ j;
}