贪吃蛇:#include
#include
#include
#include
#include
#include
#define A 39
void sj(int * a,int * b);
int main()
{
char head;
char temp;
int foodh,foodl;
int t;
int h[1600],l[1600];
int i,j;
int map[A][A];
int length;
int speed;
const int B=(A+3)/2;
system("color 1F");
length=3;
head='w';
h[0]=20;
h[1]=19;
h[2]=18;
l[0]=19;
l[1]=19;
l[2]=19;
while(1)
{
sj(&foodh,&foodl);
t=1;
for(i=0;i
{
if(foodh==h[i]||foodl==l[i])
{
t=0;
break;
}
}
if(t)
break;
}
for(i=0;i
{
for(j=0;j