c语言奢侈单的游戏胆码

#include<stdio.h>
#include<time.h>
#include<conio.h>
#include<stdlib.h>
int head=3 ,tail=0;
int main()
{
int i,j,k=0;
int zuobiao[2][80];
long start;
int direction=77;
int gamespeed;
int timeover;
int change(char qipan[20][80],int zuobiao[2][80],char direction);
zuobiao[0][tail]=1;zuobiao[1][tail]=1;zuobiao[0][1]=1;zuobiao[1][1]=2;zuobiao[0][2]=1;zuobiao[1][2]=3;zuobiao[0][head]=1;zuobiao[1][head]=4;
/*处理棋盘*/
char qipan[20][80];//定义棋盘
for(i=0;i<20;i++)
for(j=0;j<80;j++)
qipan[i][j]=' ';//初始化棋盘
for(i=0;i<80;i++)
qipan[0][i]='_';
for(i=0;i<20;i++)
qipan[i][0]='|';
for(i=0;i<20;i++)
qipan[i][79]='|';
for(i=0;i<80;i++)
qipan[19][i]='_'; 
qipan[1][1]=qipan[1][2]=qipan[1][3]='*';//初始化蛇的位置
qipan[1][4]='#';
printf("This is a game of a SNAKE.\nGOOD LUCK TO YOU !\n");
printf("Input your game speed,please.(e.g.300)\n");
scanf("%d",&gamespeed);

while(direction!='q')
{
system("cls");
for(i=0;i<20;i++)//打印出棋盘
for(j=0;j<80;j++)
printf("%c",qipan[i][j]);
timeover=1;
start=clock()();
while(!kbhit()&&(timeover=clock()()-start<=gamespeed));
if(timeover)
{
getch()();
direction=getch()();
}
else
direction=direction;
if(!(direction==72||direction==80||direction==75||direction==77))
{
return 0;
system("cls");
printf("GAME OVER!\n");
}
if(!change(qipan,zuobiao,direction))
{
direction='q'; 
system("cls");
printf("GAME OVER!\n");
}
}
return 0;
}
int change(char qipan[20][80],int zuobiao[2][80],char direction)
{
int x,y;
if(direction==72)
x=zuobiao[0][head]-1;y=zuobiao[1][head];
if(direction==80)
x=zuobiao[0][head]+1;y=zuobiao[1][head];
if(direction==75)
x=zuobiao[0][head];y=zuobiao[0][head]-1;
if(direction==77)
x=zuobiao[0][head];y=zuobiao[1][head]+1;
if(x==0||x==18||y==78||y==0)
return 0;

  http://www.huihui.cn/share/32085516

  http://www.huihui.cn/share/32086062

  http://www.huihui.cn/share/32086460

  http://www.huihui.cn/share/32086902

  http://www.huihui.cn/share/32087540

  http://www.huihui.cn/share/32088042

  http://www.huihui.cn/share/32088540

  http://www.huihui.cn/share/32088980

  http://www.huihui.cn/share/32089946

  http://www.huihui.cn/share/32090314

  http://www.huihui.cn/share/32091338

  http://www.huihui.cn/share/32091870

  http://www.huihui.cn/share/32092320

  http://www.huihui.cn/share/32092780

  http://www.huihui.cn/share/32093232

  http://www.huihui.cn/share/32093726

  http://www.huihui.cn/share/32094168

  http://www.huihui.cn/share/32094774

  http://www.huihui.cn/share/32095230

  http://www.huihui.cn/share/32095744

  http://www.huihui.cn/share/32096204

  http://www.huihui.cn/share/32096586

  http://www.huihui.cn/share/32097012

  http://www.huihui.cn/share/32097454

  http://www.huihui.cn/share/32097908

  http://www.huihui.cn/share/32098344

  http://www.huihui.cn/share/32098902

  http://www.huihui.cn/share/32099278

  http://www.huihui.cn/share/32099690

  http://www.huihui.cn/share/32100098

  http://www.huihui.cn/share/32100502

  http://www.huihui.cn/share/32101128

  http://www.huihui.cn/share/32101556

  http://www.huihui.cn/share/32102210

  http://www.huihui.cn/share/32103274

  http://www.huihui.cn/share/32103798

  http://www.huihui.cn/share/32104280

  http://www.huihui.cn/share/32104786

  http://www.huihui.cn/share/32105234

  http://www.huihui.cn/share/32105826

  http://www.huihui.cn/share/32106354

  http://www.huihui.cn/share/32106792

  http://www.huihui.cn/share/32107316

  http://www.huihui.cn/share/32107962

  http://www.huihui.cn/share/32108410

  http://www.huihui.cn/share/32108974

  http://www.huihui.cn/share/32109544

  http://www.huihui.cn/share/32110134

  http://www.huihui.cn/share/32110740

  http://www.huihui.cn/share/32111290

  http://www.huihui.cn/share/32111862

  http://www.huihui.cn/share/32112468

  http://www.huihui.cn/share/32114722

  http://www.huihui.cn/share/32117666

  http://www.huihui.cn/share/32118256

  http://www.huihui.cn/share/32120098

  http://www.huihui.cn/share/32120644

  http://www.huihui.cn/share/32121382

  http://www.huihui.cn/share/32125100

  http://www.huihui.cn/share/32125730

  http://www.huihui.cn/share/32126162

  http://www.huihui.cn/share/32126698

  http://www.huihui.cn/share/32151652

  http://www.huihui.cn/share/32152160

  http://www.huihui.cn/share/32153714

  http://www.huihui.cn/share/32154340

  http://www.huihui.cn/share/32155058

  http://www.huihui.cn/share/32159676

  http://www.huihui.cn/share/32172238

  http://www.huihui.cn/share/32173152

  http://www.huihui.cn/share/32173782

  http://www.huihui.cn/share/32174352

  http://www.huihui.cn/share/32174920

  http://www.huihui.cn/share/32175576

  http://www.huihui.cn/share/32176140

  http://www.huihui.cn/share/32176780

  http://www.huihui.cn/share/32177318

  http://www.huihui.cn/share/32177858

  http://www.huihui.cn/share/32178394

  http://www.huihui.cn/share/32179108

  http://www.huihui.cn/share/32187636

  http://www.huihui.cn/share/32188162

  http://www.huihui.cn/share/32193002

  http://www.huihui.cn/share/32198494

  http://www.huihui.cn/share/32199012

  http://www.huihui.cn/share/32200718

  http://www.huihui.cn/share/32201590

  http://www.huihui.cn/share/32202668

  http://www.huihui.cn/share/32204074

  http://www.huihui.cn/share/32206528

  http://www.huihui.cn/share/32208680

  http://www.huihui.cn/share/32209208

  http://www.huihui.cn/share/32209734

  http://www.huihui.cn/share/32225096

  http://www.huihui.cn/share/32225524

  http://www.huihui.cn/share/32226046

  http://www.huihui.cn/share/32226410

  http://www.huihui.cn/share/32226832

  http://www.huihui.cn/share/32227310

  http://www.huihui.cn/share/32227720

  http://www.huihui.cn/share/32228310

  http://www.huihui.cn/share/32229516

  http://www.huihui.cn/share/32230042

  http://www.huihui.cn/share/32230516

  http://www.huihui.cn/share/32230886

  http://www.huihui.cn/share/32231390

  http://www.huihui.cn/share/32231776

  http://www.huihui.cn/share/32232158

  http://www.huihui.cn/share/32232526

  http://www.huihui.cn/share/32232914

  http://www.huihui.cn/share/32233276

  http://www.huihui.cn/share/32233754

  http://www.huihui.cn/share/32234242

  http://www.huihui.cn/share/32234714

  http://www.huihui.cn/share/32235140

  http://www.huihui.cn/share/32235714

  http://www.huihui.cn/share/32236134

  http://www.huihui.cn/share/32236642

  http://www.huihui.cn/share/32237682

  http://www.huihui.cn/share/32241870

  http://www.huihui.cn/share/32242318

  http://www.huihui.cn/share/32242972

  http://www.huihui.cn/share/32244090

  http://www.huihui.cn/share/32244552

  http://www.huihui.cn/share/32261208

  http://www.huihui.cn/share/32262616

  http://www.huihui.cn/share/32263554

  http://www.huihui.cn/share/32264280

  http://www.huihui.cn/share/32265442

  http://www.huihui.cn/share/32266146

  http://www.huihui.cn/share/32266654

  http://www.huihui.cn/share/32267218

  http://www.huihui.cn/share/32267650

  http://www.huihui.cn/share/32268068

  http://www.huihui.cn/share/32268516

  http://www.huihui.cn/share/32269098

  http://www.huihui.cn/share/32269602

  http://www.huihui.cn/share/32270186

  http://www.huihui.cn/share/32270842

  http://www.huihui.cn/share/32271650

  http://www.huihui.cn/share/32272436

  http://www.huihui.cn/share/32275454

  http://www.huihui.cn/share/32285302

  http://www.huihui.cn/share/32285774

  http://www.huihui.cn/share/32286216

  http://www.huihui.cn/share/32286682

  http://www.huihui.cn/share/32287148

  http://www.huihui.cn/share/32287744

  http://www.huihui.cn/share/32288154

  http://www.huihui.cn/share/32288618

  http://www.huihui.cn/share/32289104

  http://www.huihui.cn/share/32289658

  http://www.huihui.cn/share/32290984

  http://www.huihui.cn/share/32291466

  http://www.huihui.cn/share/32293404

  http://www.huihui.cn/share/32293886

  http://www.huihui.cn/share/32294546

  http://www.huihui.cn/share/32295008

  http://www.huihui.cn/share/32295378

  http://www.huihui.cn/share/32295854

  http://www.huihui.cn/share/32296304

  http://www.huihui.cn/share/32296702

  http://www.huihui.cn/share/32297286

  http://www.huihui.cn/share/32297794

  http://www.huihui.cn/share/32298330

  http://www.huihui.cn/share/32298850

  http://www.huihui.cn/share/32299456

  http://www.huihui.cn/share/32299908

  http://www.huihui.cn/share/32300278

  http://www.huihui.cn/share/32302006

  http://www.huihui.cn/share/32302466

  http://www.huihui.cn/share/32304464

  http://www.huihui.cn/share/32305386

  http://www.huihui.cn/share/32306214

  http://www.huihui.cn/share/32306692

  http://www.huihui.cn/share/32307766

  http://www.huihui.cn/share/32308194

  http://www.huihui.cn/share/32309094

  http://www.huihui.cn/share/32309574

  http://www.huihui.cn/share/32310530

  http://www.huihui.cn/share/32310918

  http://www.huihui.cn/share/32315730

  http://www.huihui.cn/share/32316042

  http://www.huihui.cn/share/32316428

  http://www.huihui.cn/share/32317308

  http://www.huihui.cn/share/32317824

  http://www.huihui.cn/share/32318448

  http://www.huihui.cn/share/32319058

  http://www.huihui.cn/share/32322508

  http://www.huihui.cn/share/32323000

  http://www.huihui.cn/share/32323446

  http://www.huihui.cn/share/32323954

  http://www.huihui.cn/share/32324312

  http://www.huihui.cn/share/32327336

  http://www.huihui.cn/share/32332016

  http://www.huihui.cn/share/32332374

  http://www.huihui.cn/share/32332732

  http://www.huihui.cn/share/32333272

  http://www.huihui.cn/share/32333660

  http://www.huihui.cn/share/32333974

  http://www.huihui.cn/share/32337772

  http://www.huihui.cn/share/32338154

  http://www.huihui.cn/share/32338514

  http://www.huihui.cn/share/32338938

  http://www.huihui.cn/share/32345002

  http://www.huihui.cn/share/32345296

  http://www.huihui.cn/share/32346354

  http://www.huihui.cn/share/32346632

  http://www.huihui.cn/share/32346892

  http://www.huihui.cn/share/32347328

  http://www.huihui.cn/share/32347684

  http://www.huihui.cn/share/32348048

  http://www.huihui.cn/share/32348554

  http://www.huihui.cn/share/32350474

  http://www.huihui.cn/share/32350756

  http://www.huihui.cn/share/32351022

  http://www.huihui.cn/share/32351288

  http://www.huihui.cn/share/32351846

  http://www.huihui.cn/share/32352260

  http://www.huihui.cn/share/32356536

  http://www.huihui.cn/share/32357130

  http://www.huihui.cn/share/32357522

  http://www.huihui.cn/share/32359228

  http://www.huihui.cn/share/32359456

  http://www.huihui.cn/share/32360372

  http://www.huihui.cn/share/32360696

  http://www.huihui.cn/share/32360998

  http://www.huihui.cn/share/32361404

  http://www.huihui.cn/share/32361794

  http://www.huihui.cn/share/32362114

  http://www.huihui.cn/share/32362518

  http://www.huihui.cn/share/32362872

  http://www.huihui.cn/share/32365314

  http://www.huihui.cn/share/32365698

  http://www.huihui.cn/share/32366016

  http://www.huihui.cn/share/32366386

  http://www.huihui.cn/share/32366660

  http://www.huihui.cn/share/32367070

  http://www.huihui.cn/share/32367308

  http://www.huihui.cn/share/32367582

  http://www.huihui.cn/share/32367902

  http://www.huihui.cn/share/32368474

  http://www.huihui.cn/share/32368812

  http://www.huihui.cn/share/32369238

  http://www.huihui.cn/share/32369584

  http://www.huihui.cn/share/32370146

  http://www.huihui.cn/share/32370762

  http://www.huihui.cn/share/32371030

  http://www.huihui.cn/share/32371358

  http://www.huihui.cn/share/32371588

  http://www.huihui.cn/share/32371914

  http://www.huihui.cn/share/32372194

  http://www.huihui.cn/share/32372614

  http://www.huihui.cn/share/32378628

  http://www.huihui.cn/share/32379974

  http://www.huihui.cn/share/32380390

  http://www.huihui.cn/share/32385820

  http://www.huihui.cn/share/32386452

  http://www.huihui.cn/share/32386706

  http://www.huihui.cn/share/32387050

  http://www.huihui.cn/share/32387550

  http://www.huihui.cn/share/32397408

  http://www.huihui.cn/share/32398220

  http://www.huihui.cn/share/32398962

  http://www.huihui.cn/share/32399486

  http://www.huihui.cn/share/32399930

  http://www.huihui.cn/share/32400554

  http://www.huihui.cn/share/32400974

  http://www.huihui.cn/share/32401498

  http://www.huihui.cn/share/32401920

  http://www.huihui.cn/share/32402658

  http://www.huihui.cn/share/32403048

  http://www.huihui.cn/share/32403482

  http://www.huihui.cn/share/32410368

  http://www.huihui.cn/share/32410848

  http://www.huihui.cn/share/32411754

  http://www.huihui.cn/share/32412154

  http://www.huihui.cn/share/32412544

  http://www.huihui.cn/share/32412836

  http://www.huihui.cn/share/32413128

  http://www.huihui.cn/share/32413462

  http://www.huihui.cn/share/32413754

  http://www.huihui.cn/share/32414130

  http://www.huihui.cn/share/32414516

  http://www.huihui.cn/share/32414858

  http://www.huihui.cn/share/32415194

if(qipan[x][y]!=' ') return 0; qipan[zuobiao[0][tail]][zuobiao[1][tail]]=' '; tail=(tail+1)%80; qipan[zuobiao[0][head]][zuobiao[1][head]]='*'; head=(head+1)%80; zuobiao[0][head]=x; zuobiao[1][head]=y; qipan[zuobiao[0][head]][zuobiao[1][head]]='#'; return 1; }
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值