网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。
一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!
num++;
break;
}
}
if( i == 7){
printf("这不是你的棋子\n");
Sleep(500);
}
}
else if( round == 2)
{
for ( i = 0; i < 7; i++) //将方
{
if( strcmp(check_2[i],check) == 0)
{
turn = temp;
turn1 = temp1;
temp = '+';
temp1 = '-';
check_x = x;
check_y = y;
check_turn = 20 + i;
num++;
break;
}
}
if( i == 7){
printf("这不是你的棋子\n");
Sleep(500);
}
}
}
else if( num % 2 == 0) //放
{
/\*char check\_1[8][3] ={"车","马","象","士","将","炮","卒","+-"};
char check_2[8][3] ={“俥”,“馬”,“相”,“仕”,“帥”,“軳”,“兵”,“±”};*/
/*
中界 楚河上下坐标 12 15
*/
// 往下2 往又4
if( check_turn < 20) //将方
{
if( check_turn == 10) //车 的走法规范 完成
{
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 )
{
if( x > check_x)
{
for(j = check_x + 2; j < x;j = j + 2)
{
if(map[j][y] == '+');
else
{
printf("不合法的下发\n");
Sleep(500);
break;
}
}
if( j >= x)
check\_main1(&temp,&temp1,&turn,&turn1,&num);
}
if( x < check_x)
{
for(j = check_x - 2; j > x;j = j - 2)
{
if(map[j][y] == '+');
else
{
printf("不合法的下发\n");
Sleep(500);
break;
}
}
if( j <= x)
check\_main1(&temp,&temp1,&turn,&turn1,&num);
}
}
else if( x == check_x )
{
if( y > check_y)
{
for(j = check_y + 4; j < y;j = j + 4)
{
if(map[x][j] == '+');
else
{
printf("不合法的下发\n");
Sleep(500);
break;
}
}
if( j >= y)
check\_main1(&temp,&temp1,&turn,&turn1,&num);
}
if( y < check_y)
{
for(j = check_y - 4; j > y;j = j - 4)
{
if(map[x][j] == '+');
else
{
printf("不合法的下发\n");
Sleep(500);
break;
}
}
if( j <= y)
check\_main1(&temp,&temp1,&turn,&turn1,&num);
}
}
else
{
printf("不合法的下法\n");
Sleep(500);
}
}
if( check_turn == 11) //马 的走法规范 ok
{
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) == 8)&& map[check_x][(y+check_y)/2] =='+')
{
check\_main1(&temp,&temp1,&turn,&turn1,&num);
}
else if( (abs( x - check_x) == 4&& abs( y - check_y) == 4)&& map[(x + check_x)/2][check_y] == '+' )
{
check\_main1(&temp,&temp1,&turn,&turn1,&num);
}
else
{
printf("不合法的下法\n");
Sleep(500);
}
}
if( check_turn == 12) //相 的走法规范 完成
{
if( x >= 15 &&(abs(y - check_y) == 8 && abs(x - check_x) == 4))
{
if((x == check_x && y == check_y))
{
temp = turn;
temp1 = turn1;
turn = 'O';
turn1 = 'N';
num--;
printf("少悔棋哦\n");
printf("还是你的回合");
Sleep(500);
}
else 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);
else
{
printf("棋子卡住,不可执行");
Sleep(500);
}
}
else
{
printf("不合法的下法\n");
Sleep(500);
}
}
else
{
printf("不合法的下法\n");
Sleep(500);
}
}
if( check_turn == 13) //士 的走法规范 ok
{
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);
}
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);
}
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 + 2; j<= x ;j = j+ 2)
{
if(map[j][y] == '+' );
else
check_pao++;
}
if(check_pao == 1&& temp == '+') // 直线行走但不可吃棋子
check\_main1(&temp,&temp1,&turn,&turn1,&num);
else if( check_pao == 2 && temp != '+') //跳跃吃棋
check\_main1(&temp,&temp1,&turn,&turn1,&num);
else
{
printf("不合法的下法\n");
Sleep(500);
}
}
else
{
for(j = check_x - 2; j>= x;j = j - 2)
{
if(map[j][y] == '+' );
else
{
check_pao++;
}
}
if(check_pao == 1&& temp == '+') // 直线行走但不可吃棋子
check\_main1(&temp,&temp1,&turn,&turn1,&num);
else if( check_pao == 2 && temp != '+') //跳跃吃棋
check\_main1(&temp,&temp1,&turn,&turn1,&num);
else
{
printf("不合法的下法\n");
Sleep(500);
}
}
}
else if( x == check_x )
{
int check_pao = 0;
if( y > check_y)
{
for(j = check_y + 4; j<= y ;j = j+4)
{
if(map[x][j] == '+' );
else
check_pao++;
}
if(check_pao == 1&& temp == '+') // 直线行走但不可吃棋子
check\_main1(&temp,&temp1,&turn,&turn1,&num);
else if( check_pao == 2 && temp != '+') //跳跃吃棋
check\_main1(&temp,&temp1,&turn,&turn1,&num);
else
{
printf("不合法的下法\n");
Sleep(500);
}
}
else
{
for(j = check_y - 4; j>= y;j = j - 4)
{
if(map[x][j] == '+' );
else
check_pao++;
}
if(check_pao == 1&& temp == '+') // 直线行走但不可吃棋子
check\_main1(&temp,&temp1,&turn,&turn1,&num);
else if( check_pao == 2 && temp != '+') //跳跃吃棋
check\_main1(&temp,&temp1,&turn,&turn1,&num);
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);
else
{
printf("不合法的下法\n");
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);
else
{
printf("不合法的下法\n");
Sleep(500);
}
}
}
}
else //帅方
{
if( check_turn == 20) //车 的走法规范 完成
{
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 )
{
if( x > check_x)
{
for(j = check_x + 2; j < x;j = j + 2)
{
if(map[j][y] == '+');
else
{
printf("不合法的下发\n");
Sleep(500);
break;
}
}
if( j >= x)
check\_main2(&temp,&temp1,&turn,&turn1,&num);
}
if( x < check_x)
{
for(j = check_x - 2; j > x;j = j - 2)
{
if(map[j][y] == '+');
else
{
printf("不合法的下发\n");
Sleep(500);
break;
}
}
if( j <= x)
check\_main2(&temp,&temp1,&turn,&turn1,&num);
}
}
else if( x == check_x )
{
if( y > check_y)
{
for(j = check_y + 4; j < y;j = j + 4)
{
if(map[x][j] == '+');
else
{
printf("不合法的下发\n");
Sleep(500);
break;
}
}
if( j >= y)
check\_main2(&temp,&temp1,&turn,&turn1,&num);
}
if( y < check_y)
{
for(j = check_y - 4; j > y;j = j - 4)
{
if(map[x][j] == '+');
else
{
printf("不合法的下发\n");
Sleep(500);
break;
}
}
if( j <= y)
check\_main2(&temp,&temp1,&turn,&turn1,&num);
}
}
else
{
printf("不合法的下法\n");
Sleep(500);
}
}
if( check_turn == 21) //马 的走法规范 ok
{
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) == 8)&& map[check_x][(y+check_y)/2] =='+')
{
check\_main2(&temp,&temp1,&turn,&turn1,&num);
}
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);
}
else
{
printf("不合法的下法\n");
Sleep(500);
}
}
if( check_turn == 22) //相 的走法规范 完成
{
if( x <= 12 && (abs(y - check_y) == 8 && abs(x - check_x) == 4))
{
if((x == check_x && y == check_y))
{
temp = turn;
temp1 = turn1;
turn = 'O';
turn1 = 'N';
num--;
printf("少悔棋哦\n");
printf("还是你的回合");
Sleep(500);
}
else 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);
else
{
printf("棋子卡住,不可执行");
Sleep(500);
}
}
else
{
printf("不合法的下法\n");
Sleep(500);
}
}
else
{
printf("不合法的下法\n");
Sleep(500);
}
}
if( check_turn == 23) //士 的走法规范 ok
{
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==4 && (y == 15 || y == 23)) || ( x == 6 && y == 19) || ( x == 8 && ( y == 15 || y == 23))))
{
check\_main2(&temp,&temp1,&turn,&turn1,&num);
}
else
{
printf("不合法的下法\n");
Sleep(500);
}
}
if( check_turn == 24) //将 的走法规范 ok
{
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 >= 4 && x <= 8 && y >= 15 && y <= 23 )
{
check\_main2(&temp,&temp1,&turn,&turn1,&num);
}
else
{
printf("不合法的下法\n");
Sleep(500);
}
}
if( check_turn == 25) //炮 的走法规范
{
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 + 2; j<= x ;j = j+ 2)
{
if(map[j][y] == '+' );
else
check_pao++;
}
if(check_pao == 1&& temp == '+') // 直线行走但不可吃棋子
check\_main2(&temp,&temp1,&turn,&turn1,&num);
else if( check_pao == 2 && temp != '+') //跳跃吃棋
check\_main2(&temp,&temp1,&turn,&turn1,&num);
else
{
printf("不合法的下法\n");
Sleep(500);
}
}
else
{
for(j = check_x - 2; j>= x;j = j - 2)
{
if(map[j][y] == '+' );
else
{
check_pao++;
}
}
if(check_pao == 1&& temp== '+') // 直线行走但不可吃棋子
check\_main2(&temp,&temp1,&turn,&turn1,&num);
else if( check_pao == 2 && temp != '+') //跳跃吃棋
check\_main2(&temp,&temp1,&turn,&turn1,&num);
else
{
printf("不合法的下法\n");
Sleep(500);
}
}
}
既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上C C++开发知识点,真正体系化!
由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新
}
if(check_pao == 1&& temp== '+') // 直线行走但不可吃棋子
check\_main2(&temp,&temp1,&turn,&turn1,&num);
else if( check_pao == 2 && temp != '+') //跳跃吃棋
check\_main2(&temp,&temp1,&turn,&turn1,&num);
else
{
printf("不合法的下法\n");
Sleep(500);
}
}
}
[外链图片转存中…(img-SenWeLyd-1715590104290)]
[外链图片转存中…(img-qyy3GrfZ-1715590104291)]
既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上C C++开发知识点,真正体系化!
由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新