当前位置: 首页 > news >正文

wordpress不好优化大师app下载

wordpress不好,优化大师app下载,网站系统繁忙是什么意思,网站可以做的兼职1.输入正确的账号密码及其用户名,登录成功进入贪吃蛇游戏界面, 2.随机生成蛇头★、食物▲的位置(x,y),并使用□打印地图 3.使用w s a d按键,完成蛇头的上下左右移动 4.蛇头碰撞到食物后,吃下食物变成蛇身的一部分●…

1.输入正确的账号密码及其用户名,登录成功进入贪吃蛇游戏界面,

2.随机生成蛇头★、食物▲的位置(x,y),并使用□打印地图

3.使用w s a d按键,完成蛇头的上下左右移动

4.蛇头碰撞到食物后,吃下食物变成蛇身的一部分●,重新生成食物位置,显示在地图上

5.蛇撞墙后或蛇咬到自己的身体,程序结束,统计吃到的食物数量

#include<stdio.h>
#include <windows.h>//gotoxy()函数头文件
#include<conio.h>//getch()函数头文件
#include<time.h>#define COL 40
#define ROW 20void gotoxy(int x, int y)//形参
{HANDLE hOut;COORD pos = {x, y};// 光标的起始位(第1列,第3行) 0是第1列 2是第3行hOut = GetStdHandle(STD_OUTPUT_HANDLE);SetConsoleCursorPosition(hOut, pos);//printf("定位光标位置搜索(%d,%d)\n",pos.X,pos.Y);
}
void paintWindow(int startX,int startY,int width,int height)
{int i=0;int j=0;//起始位置gotoxy(startX,startY);printf("╔");for(i=0;i<width-2;i++){printf("═");}printf("╗");for(j=0;j<height-2;j++){gotoxy(startX,startY+1+j);printf("║");for(i=0;i<width-2;i++){printf(" ");}printf("║");}gotoxy(startX,startY + height-1);printf("╚");for(i=0;i<width-2;i++){printf("═");}printf("╝");gotoxy(20,7);printf("贪吃蛇游戏登录界面");
}int login()//登录界面
{int flag=0;int i=0;char ch;int count=0;char userName[20]={0};char passwd[20]={0};paintWindow(5,5,50,20);gotoxy(15,10);printf("用户名:");gotoxy(15,12);printf("密码:");gotoxy(22,10);while(1){while(1){ch=getch();if(count>=8)//只能输入8位{break;}if((ch>='a'&&ch<='z')||(ch>='A'&&ch<='Z')){userName[i]=ch;putch(ch);i++;count++;}else if(ch==13) break;//13为回车的ascll码值else if(ch=='\b')//删除的转义字符{if(count>0){printf("\b \b");count--;userName[i]='\0';}}}gotoxy(22,12);count=0;i=0;while(1){ch=getch();if(count>=12)//只能输入12位{break;}if(ch>='0'&&ch<='9'){passwd[i]=ch;putch('*');i++;count++;}else if(ch==13) break;else if(ch=='\b')//删除的转义字符{if(count>0){printf("\b \b");count--;passwd[i]='\0';}}}gotoxy(22,18);if(strcmp(userName,"chen")==0&&strcmp(passwd,"1234")==0){printf("登录成功!\n");flag=1;break;}else{printf("用户名或密码错误!请重新输入!");i=0;count=0;memset(userName,0,sizeof(userName));//将数组里的值初始化memset(passwd,0,sizeof(passwd));system("cls");//刷新屏幕paintWindow(5,5,50,20);gotoxy(15,10);printf("用户名:");gotoxy(15,12);printf("密码:");gotoxy(24,10);}}return flag;
}
int snake[100][2];//蛇身
int main()
{int i,j;int flag=0;//用来判断贪吃蛇界面是绘制蛇头蛇身还是屏幕int foodx,foody;int s=0;//保存蛇身长度int snakeLen=1;//开始一个蛇头int score=0;//得分int tt;char ch;char ch2;srand(time(NULL));foodx=rand()%COL;//列xfoody=rand()%ROW;//行ysnake[0][0]=rand()%COL;//xsnake[0][1]=rand()%ROW;//ytt=login();//密码正确进入游戏if(tt==1){system("cls");while(1){for(i=0;i<ROW;i++)//行{for(j=0;j<COL;j++)//列{if(foodx==j&&foody==i){printf("▲");flag=1;}for(s=0;s<snakeLen;s++){if(snake[s][0]==j&&snake[s][1]==i&&s==0){printf("★");flag=1;}else if(snake[s][0]==j&&snake[s][1]==i){printf("●");flag=1;}}if(flag==0){printf("□");}flag=0;}//printf("\n");}//跟进蛇身长度for(i=snakeLen;i>0;i--){snake[i][0]=snake[i-1][0];snake[i][1]=snake[i-1][1];}//上下左右ch=getch();switch(ch){case 'w':system("cls");snake[0][1]-=1;break;case 's':system("cls");snake[0][1]+=1;break;case 'a':system("cls");snake[0][0]-=1;break;case 'd':system("cls");snake[0][0]+=1;break;default:break;}//判断游戏结束,碰墙if(snake[0][0]<0||snake[0][0]>=COL||snake[0][1]<0||snake[0][1]>=ROW){system("cls");//按'y'继续,按esc结束printf("是否继续游戏!按'a'可复活继续!\n按'y'重新开始游戏!\n按'esc'结束游戏!");ch2=getch();if(ch2=='a'){system("cls");continue;}else if(ch2=='y'){system("cls");snake[0][0]=rand()%COL;//xsnake[0][1]=rand()%ROW;//ysnakeLen=1;printf("你的总得分:%d分!\n",score);score=0;continue;}else if(ch2==27){printf("\n\n*************************游戏结束!*******************\n");printf("你的总分为:%d分!\n",score);return 0;}}//蛇头碰到蛇身游戏结束for(s=1;s<snakeLen;s++){if(snake[0][0]==snake[s][0]&&snake[0][1]==snake[s][1]){system("cls");//按'y'继续,按esc结束printf("是否继续游戏!\n按'a'可复活继续!\n按'y'重新开始游戏!\n按'esc'结束游戏!");ch2=getch();if(ch2=='a'){system("cls");continue;}else if(ch2=='y'){system("cls");snake[0][0]=rand()%COL;//xsnake[0][1]=rand()%ROW;//ysnakeLen=1;printf("你的总得分:%d分!\n",score);score=0;continue;}else if(ch2==27){printf("\n\n***************************游戏结束!**********************\n");printf("你的总分为:%d分!\n",score);return 0;}}}//吃到食物if(snake[0][0]==foodx&&snake[0][1]==foody){system("cls");foodx=rand()%COL;foody=rand()%ROW;snakeLen++;score++;//每次吃到食物分数累加}}}return 0;}


 

http://www.dt0577.cn/news/5476.html

相关文章:

  • 电商培训在线课程北京网络优化
  • 网站域名做链接怎么做专门的网页制作工具有
  • 做爰网站名称微信加精准客源软件
  • 怎么看一个网站做没做竞价seo招聘要求
  • 网页qq空间在线登录做关键词优化
  • 怎么做自己的cms导购网站网站权重查询
  • 公司做网站花销会计分录资深seo顾问
  • 做仿牌网站空间seo的作用主要有
  • 做一个企业网站需要多少钱国内打开google网页的方法
  • 网站建设及编辑岗位职责兰州seo培训
  • 企查查网站建站开发
  • 国外 外贸 网站 源码seo顾问推推蛙
  • 做张家界旅游网站多少钱电商网站seo怎么做
  • wap网站现在还有什么用如何搜索关键词热度
  • 自己建设网站需要哪些怎么自己做一个网址
  • 企业融资渠道有哪些优化疫情二十条措施
  • 企业年报查询网站seo快速排名是什么
  • 做时时彩网站平台媒体:北京不再公布疫情数据
  • 做响应式网站制作百度开户推广
  • 做定制网站需要多少钱
  • 免费商标查询平台网站内部优化有哪些内容
  • 免费的b2b网站可以做外贸百度seo外包
  • 网站怎么做第二个页面seo是什么意思啊
  • wordpress html 单页郑州seo优化大师
  • 网站提交入口大全郑州seo推广
  • seo技术好的培训机构seo权重优化软件
  • 什么样的网站才是好网站seo服务是什么意思
  • 还有哪些网站可以做淘宝活动网站建设合同模板
  • 中国建设银行注册网站用户名怎么填引流app推广软件
  • 网站建设的毕业设计选题管理系统百度搜索优化建议