大佬急求

这里有个bug需要大佬帮忙指点改一下,急急急
#include<stdio.h>
#include<stdlib.h>
#include<windows.h>
#include <conio.h>

/测控17-2班 在这里插入图片描述。。。。。。/

void welcome2018()
{
int a,n=0;
printf("*****************************来了老弟?*********************\n\n");
printf("你好,我是小智,真好!
\n\n");
printf("这有个五子棋游戏,爱玩不玩
\n\n");
printf("想玩就必须召唤三只皮卡丘
\n\n");
printf("下雪了!买了佛冷!
\n\n");
printf("************************请输入你的召唤密码:");
while(n<3)
{
scanf("%d",&a);
if(a>=66)
{
printf(“这是一只皮卡丘\n”);
n++;
}
else
printf(“这是一只妙蛙种子\n”);
}
printf("\n");
printf(“恭喜您召唤成功,游戏即将开启…”);
Sleep(2000) ;//暂停两秒
system(“cls”);//清屏
char e; int f;
printf("\t欢迎来到孙哲韦版五子棋寻宝之旅\n\n");
printf("\t请先注册一个id\n\n");
printf("\t\t用户名(姓名):");
scanf("%s",&e);
printf("\n\t\t密码(学号)?;
scanf("%d",&f);
printf("\n\n\t注册成功,寻宝之旅即将开始…\n\n");
Sleep(3000);
}

int main()
{
welcome2018();

char y;
 int i, j, m = 7, n = 7, g = 1, f,w;
  int a[15][15] = { 0 };
   a[m][n] = -1;
                                    
do
{
	for (j = 0; j<15; j++)

	{
		for (i = 0; i<15; i++)

			switch (a[i][j])
		{
			case 0:printf("十"); break;
			case -1:printf("×"); break;
			case 1:printf("○"); break;
			case 2:printf("●");break;
		}
		printf("\n");
	
	}	 

printf(“按‘W’向上移动一格\t”); printf(“按‘S’向下移动一格\n”);
printf(“按‘A’向左移动一格\t”); printf(“按‘D’向右移动一格\n”);
printf(“按‘空格’落子\t\t”); printf(“按‘Q’退出游戏\n”);
f = (g % 2);
if(w!=1&&w!=2) {if(f!=1)printf(“请二号玩家黑棋落子:\n”);
else printf(“请一号玩家白棋落子:\n”);}

	y = getch();
	if (a[m][n] == -1)a[m][n] = 0;
	switch (y)
	{
	  case'a':m--; if (m == -1)m = 14; else;if (a[m][n] == 0)a[m][n] = -1; break;
		  
	  case'd':m++; if (m == 15)m = 0; else; if (a[m][n] == 0)a[m][n] = -1; break;
		 
	  case'w':n--; if (n == -1)m = 14; else; if (a[m][n] == 0)a[m][n] = -1; break;
		 
	  case's':n++; if (n == 15)m = 0; else; if (a[m][n] == 0)a[m][n] = -1; break;
		 
	  case' ': if (a[m][n] == 0){ if (f == 0)a[m][n] = 1;else a[m][n] = 2; g++; }else; break;//空格
	}
		
	system("cls");
	
	{
	if(a[m][n]==2&&a[m+1][n]==2&&a[m+2][n]==2&&a[m+3][n]==2&&a[m+4][n]==2)w=1;
	if(a[m][n]==2&&a[m+1][n]==2&&a[m+2][n]==2&&a[m+3][n]==2&&a[m-1][n]==2)w=1;
	if(a[m][n]==2&&a[m+1][n]==2&&a[m+2][n]==2&&a[m-1][n]==2&&a[m-2][n]==2)w=1;
	if(a[m][n]==2&&a[m+1][n]==2&&a[m-1][n]==2&&a[m-2][n]==2&&a[m-3][n]==2)w=1;
	if(a[m][n]==2&&a[m-1][n]==2&&a[m-2][n]==2&&a[m-3][n]==2&&a[m-4][n]==2)w=1;
	if(a[m][n]==2&&a[m][n+1]==2&&a[m][n+2]==2&&a[m][n+3]==2&&a[m][n+4]==2)w=1;
	if(a[m][n]==2&&a[m][n+1]==2&&a[m][n+2]==2&&a[m][n+3]==2&&a[m][n-1]==2)w=1;
	if(a[m][n]==2&&a[m][n+1]==2&&a[m][n+2]==2&&a[m][n-1]==2&&a[m][n-2]==2)w=1;
	if(a[m][n]==2&&a[m][n+1]==2&&a[m][n-1]==2&&a[m][n-2]==2&&a[m][n-3]==2)w=1;
	if(a[m][n]==2&&a[m][n-1]==2&&a[m][n-2]==2&&a[m][n-3]==2&&a[m][n-4]==2)w=1;
	if(a[m][n]==2&&a[m+1][n+1]==2&&a[m+2][n+2]==2&&a[m+3][n+3]==2&&a[m+4][n+4]==2)w=1;
	if(a[m][n]==2&&a[m+1][n+1]==2&&a[m+2][n+2]==2&&a[m+3][n+3]==2&&a[m-1][n-1]==2)w=1;
	if(a[m][n]==2&&a[m+1][n+1]==2&&a[m+2][n+2]==2&&a[m-1][n-1]==2&&a[m-2][n-2]==2)w=1;
	if(a[m][n]==2&&a[m+1][n+1]==2&&a[m-1][n-1]==2&&a[m-2][n-2]==2&&a[m-3][n-3]==2)w=1;
	if(a[m][n]==2&&a[m-1][n-1]==2&&a[m-2][n-2]==2&&a[m-3][n-3]==2&&a[m-4][n-4]==2)w=1; 
	if(a[m][n]==2&&a[m-1][n+1]==2&&a[m-2][n+2]==2&&a[m-3][n+3]==2&&a[m-4][n+4]==2)w=1;
	if(a[m][n]==2&&a[m-1][n+1]==2&&a[m-2][n+2]==2&&a[m-3][n+3]==2&&a[m+1][n-1]==2)w=1;
	if(a[m][n]==2&&a[m-1][n+1]==2&&a[m-2][n+2]==2&&a[m+1][n-1]==2&&a[m+2][n-2]==2)w=1;
	if(a[m][n]==2&&a[m-1][n+1]==2&&a[m+1][n-1]==2&&a[m+2][n-2]==2&&a[m+3][n-3]==2)w=1;
	if(a[m][n]==2&&a[m+1][n-1]==2&&a[m+2][n-2]==2&&a[m+3][n-3]==2&&a[m+4][n-4]==2)w=1;  
	
	
	
	
	
	if(a[m][n]==1&&a[m+1][n]==1&&a[m+2][n]==1&&a[m+3][n]==1&&a[m+4][n]==1)w=2;
	if(a[m][n]==1&&a[m+1][n]==1&&a[m+2][n]==1&&a[m+3][n]==1&&a[m-1][n]==1)w=2;
	if(a[m][n]==1&&a[m+1][n]==1&&a[m+2][n]==1&&a[m-1][n]==1&&a[m-2][n]==1)w=2;
	if(a[m][n]==1&&a[m+1][n]==1&&a[m-1][n]==1&&a[m-2][n]==1&&a[m-3][n]==1)w=2;
	if(a[m][n]==1&&a[m-1][n]==1&&a[m-2][n]==1&&a[m-3][n]==1&&a[m-4][n]==1)w=2; 
	if(a[m][n]==1&&a[m][n+1]==1&&a[m][n+2]==1&&a[m][n+3]==1&&a[m][n+4]==1)w=2;
	if(a[m][n]==1&&a[m][n+1]==1&&a[m][n+2]==1&&a[m][n+3]==1&&a[m][n-1]==1)w=2;
	if(a[m][n]==1&&a[m][n+1]==1&&a[m][n+2]==1&&a[m][n-1]==1&&a[m][n-2]==1)w=2;
	if(a[m][n]==1&&a[m][n+1]==1&&a[m][n-1]==1&&a[m][n-2]==1&&a[m][n-3]==1)w=2;
	if(a[m][n]==1&&a[m][n-1]==1&&a[m][n-2]==1&&a[m][n-3]==1&&a[m][n-4]==1)w=2; 
	if(a[m][n]==1&&a[m+1][n+1]==1&&a[m+2][n+2]==1&&a[m+3][n+3]==1&&a[m+4][n+4]==1)w=2;
	if(a[m][n]==1&&a[m+1][n+1]==1&&a[m+2][n+2]==1&&a[m+3][n+3]==1&&a[m-1][n-1]==1)w=2;
	if(a[m][n]==1&&a[m+1][n+1]==1&&a[m+2][n+2]==1&&a[m-1][n-1]==1&&a[m-2][n-2]==1)w=2;
	if(a[m][n]==1&&a[m+1][n+1]==1&&a[m-1][n-1]==1&&a[m-2][n-2]==1&&a[m-3][n-3]==1)w=2;
	if(a[m][n]==1&&a[m-1][n-1]==1&&a[m-2][n-2]==1&&a[m-3][n-3]==1&&a[m-4][n-4]==1)w=2; 
	if(a[m][n]==1&&a[m-1][n+1]==1&&a[m-2][n+2]==1&&a[m-3][n+3]==1&&a[m-4][n+4]==1)w=2;
	if(a[m][n]==1&&a[m-1][n+1]==1&&a[m-2][n+2]==1&&a[m-3][n+3]==1&&a[m+1][n-1]==1)w=2;
	if(a[m][n]==1&&a[m-1][n+1]==1&&a[m-2][n+2]==1&&a[m+1][n-1]==1&&a[m+2][n-2]==1)w=2;
	if(a[m][n]==1&&a[m-1][n+1]==1&&a[m+1][n-1]==1&&a[m+2][n-2]==1&&a[m+3][n-3]==1)w=2;
	if(a[m][n]==1&&a[m+1][n-1]==1&&a[m+2][n-2]==1&&a[m+3][n-3]==1&&a[m+4][n-4]==1)w=2;
	}

if(w1)
printf("\n 恭喜一号玩家获得胜利!\n\t 请按Q退出\n\n\n");
if(w
2)
printf("\n 恭喜二号玩家获得胜利!\n\t 请按Q退出\n\n\n");}

 while (y != 'q'); 

return 0;
}

©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页