易码技术论坛

 找回密码
 加入易码
搜索
查看: 100860|回复: 3

[求助]有什么问题??

[复制链接]
发表于 2005-5-22 17:33:00 | 显示全部楼层
编译器哪里报错?
发表于 2005-5-22 18:09:00 | 显示全部楼层
汗~汗~发现你的问题所在了……在Pass()函数最后,少了一个“}”
写程序的手误吧?
 楼主| 发表于 2005-5-25 21:02:00 | 显示全部楼层
O!谢谢了.....
 楼主| 发表于 2005-5-22 16:41:18 | 显示全部楼层 |阅读模式
int a[3][3]={1,2,3,4,5,6,7,8,0};
int s,b,zc,ss,bb,i,j,ok;
char x=2,y=2,aj,esc;
void new()
{
for(i;i<500;i++)
  {s=rand()%3;
   ss=rand()%3;
   bb=rand()%3;
   b=rand()%3;
   zc=a[ss];
   a[ss]=a[bb];
   a[bb]=zc;
   }
}
void anjian()
{for(;;)
{aj=getchar();
if(aj=20&&y>0){a[x][y]=a[x][y-1];
a[x][y-1]=0;esc=1;y--;}
if(aj=21&&y<2){a[x][y]=a[x][y+1];a[x][y+1]=0;esc=1;y++;}
if(aj=22&&x<2){a[x][y]=a[x+1][y];a[x+1][y]=0;esc=1;x++;}
if(aj=23&&x>0){a[x][y]=a[x-1][y];a[x-1][y]=0;esc=1;x--;}
if(aj=27)exit(0);
if(esc=1)break;
}
}
void draw()
{SetScreen(1);
for (i=0;i<3;i++)
{for (j=0;j<3;j++)
  {Locate(i+1,j+8);
;   printf("%c,a[j]");
  }
}
}
void pass()
{for(i=0;i<3;i++)
{for(j=0;j<3;j++)
  {if(a[j]>1+i*3+j)
  {ok=0;return;
}
}
ok=1;
}
void main()
{
new();
for(;;)
{anjian();
draw();
pass();
if(ok=1)break;
}
SetScreen(1);
printf("you win\nmady by 谷虫");
getchar();
}




HELP ME!!!!!!!
您需要登录后才可以回帖 登录 | 加入易码

本版积分规则

Archiver|手机版|小黑屋|EMAX Studio

GMT+8, 2024-5-19 23:47 , Processed in 0.009713 second(s), 18 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表