//要接上一篇文章喔
cout
cout
cout
cout
cout
cout
cout
cout
cout
cout
cout
cout
cout ";
choice=0;
cin>>choice; cin.get();
if(choice==1)break;
else if(choice==2)
{
while(choice!=0)
{
system("cls");
choice=0;
cout>"
cout
cout
cout ";
cin>>choice;
cout
if(choice==1)
{
cout
cout
cout
cout ";
cin>>velocity;
}
}
}
system("cls");
cout
system("pause");
system("cls");
}
if(ca==-32)
{
ca=getch();
if(ca==72 && direction!=2)direction=8;//上
else if(ca==80 && direction!=8)direction=2;//下
else if(ca==75 && direction!=6)direction=4;//左
else if(ca==77 && direction!=4)direction=6;//右
}
}
if(!f_exist)
{
do{
f_exist=true;
food=rand()%960;
if(va[food]!=0)f_exist=false;
else
{
va[food]=-1;
board[food*2]=foodsign[0],board[food*2+1]=foodsign[1];
}
}while(!f_exist);
}
int vc=move_head(&head,direction,board,va);
if(vc==0)break;
else if(vc==1)f_exist=false;
else if(vc==2)move_tail(&tail,board,va);
cout
Sleep(velocity);
}
system("cls");
cout
system("pause");
}
亂貼小站公告欄
- Feb 16 Sat 2008 11:02
貪吃蛇程式2
close
全站熱搜
留言列表