关于微信象棋怎么玩这个问题我之前遇到过,挺容易解决的,接下来就跟大家讲讲应该怎么 *** 作。
工具:iphone11,微信8.0.33。
第一步,打开微信,下拉进入小程序窗口。(如下图所示)
第二步,点击左上角象棋小程序图标。(如下图所示)
第三步,勾选阅读并同意,点击开始。(如下图所示)
第四步,点击象棋进入象棋窗口后,点击棋力评测。(如下图所示)
第五步,最后,点击快速开始即可开始象棋对战。(如下图所示)
以上就是微信象棋怎么玩的所有步骤啦,对你有用的话记得帮忙点赞点关注呀~。
接上面中国象棋代码:
if( check_turn == 12) //相的走法规范
{ if((x == check_x &&y == check_y))
{temp = turn temp1 = turn1 turn = 'O' turn1 = 'N' num--
printf("三思而后行\n")printf("还是你的回合")Sleep(500)
}
else if( x >= 15 &&(abs(y - check_y) == 8 &&abs(x - check_x) == 4))
{if((x == 22 &&(y == 11 || y == 27))||(x == 18 &&
( y == 3 || y == 19 || y == 35)) ||(x == 14 &&(y == 11|| y ==27)))
{ if( map[(x+check_x)/2][(y+check_y)/2] == '+') check_main1(&temp,&temp1,&turn,&turn1,&num,&if_return,map)
else {printf("棋子卡住,不可执行")Sleep(500)} }
else {printf("不合法的下法\n")Sleep(500)}
}
else {printf("不合法的下法\n")Sleep(500)}
}
if( check_turn == 13) //士的走法规范
{ if((x == check_x &&y == check_y))
{temp = turn temp1 = turn1 turn = 'O' turn1 = 'N' num--
printf("三思而后行\n")printf("还是你的回合")Sleep(500) }
else if( abs(x - check_x)== 2 &&abs( y - check_y) == 4 &&((x==22 &&(y == 15
|| y == 23)) || ( x == 20 &&y == 19) || ( x == 18 &&( y == 15 || y == 23)))) {check_main1(&temp,&temp1,&turn,&turn1,&num,&if_return,map)}
else { printf("不合法的下法\n")Sleep(500)} }
if( check_turn == 14) //将的走法规范
{ if((x == check_x &&y == check_y))
{ temp = turn temp1 = turn1 turn = 'O' turn1 = 'N' num--
printf("三思而后行\n")printf("还是你的回合")Sleep(500) }
else if( ((abs(x - check_x)== 2 &&abs( y - check_y) == 0 )|| (abs(x - check_x)== 0
&&abs( y - check_y) == 4)) &&x >= 18 &&x <= 22 &&y >= 15 &&y <= 23 )
{ check_main1(&temp,&temp1,&turn,&turn1,&num,&if_return,map)}
else { printf("不合法的下法\n")Sleep(500)} }
if( check_turn == 15) //炮的走法规范
{ if((x == check_x &&y == check_y))
{ temp = turn temp1 = turn1 turn = 'O' turn1 = 'N' num--
printf("三思而后行\n")printf("还是你的回合")Sleep(500) }
else if( y == check_y )
{ int check_pao = 0
if( x >check_x)
{ for(j = check_x + 2j<= x j = j+ 2)
{ if(map[j][y] == '+' ) else check_pao++}
if(check_pao == 1&&temp == '+') // 直线行走但不可吃棋子 check_main1(&temp,&temp1,&turn,&turn1,&num,&if_return,map)
else if( check_pao == 2 &&temp != '+') //跳跃吃棋 check_main1(&temp,&temp1,&turn,&turn1,&num,&if_return,map)
else { printf("不合法的下法\n")Sleep(500)} }
else { for(j = check_x - 2j>= xj = j - 2)
{ if(map[j][y] == '+' ) else { check_pao++} }
if(check_pao == 1&&temp == '+') //直线行走但不可吃棋子 check_main1(&temp,&temp1,&turn,&turn1,&num,&if_return,map)
else if( check_pao == 2 &&temp != '+') //跳跃吃棋 check_main1(&temp,&temp1,&turn,&turn1,&num,&if_return,map)
else { printf("不合法的下法\n")Sleep(500)} }
}
else if( x == check_x )
{ int check_pao = 0
if( y >check_y)
{ for(j = check_y + 4j<= y j = j+4)
{ if(map[x][j] == '+' ) else check_pao++}
if(check_pao == 1&&temp == '+') //直线行走但不可吃棋子 check_main1(&temp,&temp1,&turn,&turn1,&num,&if_return,map)
else if( check_pao == 2 &&temp != '+') //跳跃吃棋 check_main1(&temp,&temp1,&turn,&turn1,&num,&if_return,map)
else { printf("不合法的下法\n")Sleep(500)} }
else {for(j = check_y - 4j>= yj = j - 4)
{if(map[x][j] == '+' ) else check_pao++}
if(check_pao == 1&&temp == '+') //直线行走但不可吃棋子 check_main1(&temp,&temp1,&turn,&turn1,&num,&if_return,map)
else if( check_pao == 2 &&temp != '+') //跳跃吃棋 check_main1(&temp,&temp1,&turn,&turn1,&num,&if_return,map)
else { printf("不合法的下法\n")Sleep(500)} }
}
else { printf("不合法的下法\n")Sleep(500)}
}
if( check_turn == 16) //卒的走法规范
{ if ( x >= 14)
{ if((x == check_x &&y == check_y))
{ temp = turn temp1 = turn1 turn = 'O' turn1 = 'N' num--
printf("三思而后行\n")printf("还是你的回合") Sleep(500) }
else if( x == check_x - 2 &&y == check_y) check_main1(&temp,&temp1,&turn,&turn1,&num,&if_return,map)
else { printf("不合法的下法\n")Sleep(500)}
}
else{ if((x == check_x &&y == check_y))
{ temp = turn temp1 = turn1 turn = 'O' turn1 = 'N' num--
printf("三思而后行\n")printf("还是你的回合")Sleep(500) }
else if((x - check_x == 0 &&abs(y-check_y) ==4) ||( x - check_x == -2
&&abs(y-check_y) == 0)) check_main1(&temp,&temp1,&turn,&turn1,&num,&if_return,map)
else { printf("不合法的下法\n")Sleep(500)} }
}
}
else { if( check_turn == 20) //车的走法规范 (帅方)
{ if((x == check_x &&y == check_y))
{ temp = turn temp1 = turn1turn = 'O'turn1 = 'N' num--
printf("三思而后行\n")printf("还是你的回合")Sleep(500) }
else if( y == check_y )
{ if( x >check_x)
{ for(j = check_x + 2j <xj = j + 2)
{ if(map[j][y] == '+')else {printf("不合法的下法\n")Sleep(500)break} }
if( j >= x) check_main2(&temp,&temp1,&turn,&turn1,&num,&if_return,map)
}
if( x <check_x)
{ for(j = check_x - 2j >xj = j - 2)
{ if(map[j][y] == '+')else { printf("不合法的下法\n")Sleep(500)break} }
if( j <= x) check_main2(&temp,&temp1,&turn,&turn1,&num,&if_return,map)
}
}
else if( x == check_x )
{ if( y >check_y)
{ for(j = check_y + 4j <yj = j + 4)
{ if(map[x][j] == '+')else { printf("不合法的下法\n")Sleep(500)break} }
if( j >= y) check_main2(&temp,&temp1,&turn,&turn1,&num,&if_return,map)
}
if( y <check_y)
{ for(j = check_y - 4j >yj = j - 4)
{ if(map[x][j] == '+')else { printf("不合法的下法\n")Sleep(500)break} }
if( j <= y) check_main2(&temp,&temp1,&turn,&turn1,&num,&if_return,map)
}
}
else { printf("不合法的下法\n")Sleep(500)}
}
if( check_turn == 21) //马的走法规范
{ if((x == check_x &&y == check_y))
{ temp = turntemp1 = turn1turn = 'O'turn1 = 'N'num--
printf("三思而后行\n")printf("还是你的回合")Sleep(500)}
else if( (abs( x - check_x) == 2&&abs( y - check_y) == 8)&&
map[check_x][(y+check_y)/2] =='+')
{ check_main2(&temp,&temp1,&turn,&turn1,&num,&if_return,map)}
else if( (abs( x - check_x) == 4&&abs( y - check_y) == 4)&&
map[(x + check_x)/2][check_y] == '+' )
{ check_main2(&temp,&temp1,&turn,&turn1,&num,&if_return,map)}
else { printf("不合法的下法\n")Sleep(500)} }
if( check_turn == 22) //相的走法规范
{ if((x == check_x &&y == check_y))
{ temp = turntemp1 = turn1turn = 'O'turn1 = 'N'num--
printf("三思而后行\n")printf("还是你的回合")Sleep(500)}
else if( x <= 12 &&(abs(y - check_y) == 8 &&abs(x - check_x) == 4))
{ if((x == 4 &&(y == 11 || y == 27))||(x == 8 &&( y == 3 || y == 19 || y == 35))
||(x == 12 &&(y == 11|| y ==27)))
{ if( map[(x+check_x)/2][(y+check_y)/2] == '+') check_main2(&temp,&temp1,&turn,&turn1,&num,&if_return,map)
else { printf("棋子卡住,不可执行")Sleep(500)} }
else {printf("不合法的下法\n")Sleep(500)}
}
else { printf("不合法的下法\n")Sleep(500)} }
if( check_turn == 23) //士的走法规范
{ if((x == check_x &&y == check_y))
{ temp = turntemp1 = turn1turn = 'O'turn1 = 'N'num--
printf("三思而后行\n")printf("还是你的回合")Sleep(500) }
else if( abs(x - check_x)== 2 &&abs( y - check_y) == 4 &&((x==4 &&
(y == 15 || y == 23)) || ( x == 6 &&y == 19) || ( x == 8 &&( y == 15 || y == 23))))
{ check_main2(&temp,&temp1,&turn,&turn1,&num,&if_return,map)}
else { printf("不合法的下法\n")Sleep(500)} }
if( check_turn == 24) //将的走法规范
{ if((x == check_x &&y == check_y))
{ temp = turntemp1 = turn1turn = 'O'turn1 = 'N'num--
printf("三思而后行\n")printf("还是你的回合")Sleep(500) }
else if( ((abs(x - check_x)== 2 &&abs( y - check_y) == 0 )|| (abs(x - check_x)== 0 &&abs( y - check_y) == 4)) &&x >= 4 &&x <= 8 &&y >= 15 &&y <= 23 )
{ check_main2(&temp,&temp1,&turn,&turn1,&num,&if_return,map)}
else {printf("不合法的下法\n")Sleep(500)} }
if( check_turn == 25) //炮的走法规范
{ if((x == check_x &&y == check_y))
{ temp = turn temp1 = turn1turn = 'O'turn1 = 'N'num--
printf("三思而后行\n")printf("还是你的回合")Sleep(500) }
else if( y == check_y )
{ int check_pao = 0
if( x >check_x)
{ for(j = check_x + 2j<= x j = j+ 2)
{ if(map[j][y] == '+' ) else check_pao++}
if(check_pao == 1&&temp == '+') //直线行走但不可吃棋子 check_main2(&temp,&temp1,&turn,&turn1,&num,&if_return,map)
else if( check_pao == 2 &&temp != '+') //跳跃吃棋 check_main2(&temp,&temp1,&turn,&turn1,&num,&if_return,map)
else { printf("不合法的下法\n")Sleep(500)} }
else { for(j = check_x - 2j>= xj = j - 2)
{ if(map[j][y] == '+' ) else { check_pao++} }
if(check_pao == 1&&temp== '+') //直线行走但不可吃棋子 check_main2(&temp,&temp1,&turn,&turn1,&num,&if_return,map)
else if( check_pao == 2 &&temp != '+') //跳跃吃棋 check_main2(&temp,&temp1,&turn,&turn1,&num,&if_return,map)
else { printf("不合法的下法\n")Sleep(500)} }
}
else if( x == check_x )
{ int check_pao = 0
if( y >check_y)
{ for(j = check_y + 4j<= y j = j+4)
{ if(map[x][j] == '+' ) else check_pao++}
if(check_pao == 1&&temp == '+') //直线行走但不可吃棋 check_main2(&temp,&temp1,&turn,&turn1,&num,&if_return,map)
else if( check_pao == 2 &&temp != '+') //跳跃吃棋 check_main2(&temp,&temp1,&turn,&turn1,&num,&if_return,map)
else { printf("不合法的下法\n")Sleep(500)} }
else { for(j = check_y - 4 j>= yj = j - 4)
{ if(map[x][j] == '+' ) else check_pao++}
if(check_pao ==1&&temp == '+') //直线行走但不可吃棋子 check_main2(&temp,&temp1,&turn,&turn1,&num,&if_return,map)
else if( check_pao == 2&&temp != '+') //跳跃吃棋 check_main2(&temp,&temp1,&turn,&turn1,&num,&if_return,map)
else { printf("不合法的下法\n")Sleep(500)} }
}
else { printf("不合法的下法\n")Sleep(500)}
}
if( check_turn == 26) //卒的走法规范
{ if( x <= 12)
{ if((x == check_x &&y == check_y))
{ temp = turntemp1 = turn1turn = 'O'turn1 = 'N'num--
printf("三思而后行\n")printf("还是你的回合")Sleep(500)}
else if( x == check_x + 2 &&y == check_y) check_main2(&temp,&temp1,&turn,&turn1,&num,&if_return,map)
else { printf("不合法的下法\n")Sleep(500)} }
else{ if((x == check_x &&y == check_y))
{ temp = turntemp1 = turn1turn = 'O'turn1 = 'N'num--
printf("三思而后行\n")printf("还是你的回合")Sleep(500) }
else if((x - check_x == 0 &&abs(y-check_y) ==4) ||( x - check_x == 2
&&abs(y-check_y) == 0)) check_main2(&temp,&temp1,&turn,&turn1,&num,&if_return,map)
else { printf("不合法的下法\n")Sleep(500)} }
}
}
}
}
system("cls")
if( if_return) return
for(i = 0i <27i++)puts(map[i])
}
Sleep(5000)
}
int main( )
{ while(1)
{ xiangqi( )
printf("\n 重来,请按键.\n")
getch( )
}
return 0
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)