



全文预览已结束
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
#include #include #include #include using namespace std;/-int length=2,bewall=0,beeaten=0,gameover=0,score=0,speeding,level,a,b;char ch;int row,column,endrow,endcolumn;double city300;int coor1621;/-void direction(double city,char ch)for(int i=length;i=2;i-)cityi=cityi-1;if(ch=w)if(int)(city1)2) city1=city1-1;else bewall=1;else if(ch=a)if(int)(city1*100)%1002) city1=city1-0.01;else bewall=1;else if(ch=s)if(int)(city1)14) city1=city1+1;else bewall=1;else if(ch=d)if(int)(city1*100)%10019) city1=city1+0.01;else bewall=1;void randf()srand(time(0);row=rand()%13+2;column=rand()%18+2;void wall()/int a=(int)(city1);/int b=(int)(city1-a)*100);if(a=1 | a=15 | b=1 | b=20) bewall=1;for(int i=3;i=length;i+)int k=(int)(cityi);int y=(int)(cityi-k)*100);if(k=a & y=b)bewall=1;break;void eat()a=(int)(city1);b=(int)(city1-a)*100);if(a=row & b=column)length+;beeaten=1;score=score+10;int main() CO:system(cls);memset(coor,0,sizeof(coor);memset(city,0,sizeof(city);bewall=0,gameover=0,beeaten=0,level=1;length=2;while(1)cout endl;coutwasdendl;cout score = 0endl;cout level = 1endl;city1=7.09;city2=7.10;memset(coor,0,sizeof(coor);coor79=2;coor710=1;randf();if(coorrowcolumn=1) continue;for(int i=1;i16;i+)if(i=1 |i=15)for(int j=1;j21;j+)cout-;coutendl;elsecout|;for(int j=2;j20;j+)if(coorij=1) cout+;else if(i=row &j=column) cout*;else if(coorij=2) cout;else cout ;cout|endl;while(1)speeding=500-99*level;long start=clock();while(clock()-start=speeding & !kbhit();if(kbhit() ch=getch();/a=(int)(city1);/b=(int)(city1-a)*100);direction(city,ch);eat();if(beeaten)citylength=endrow+(endcolumn*1.0)/100.0;while(1)randf();if(coorrowcolumn!=1) break;beeaten=0;endrow=(int)(citylength);endcolumn=(int)(citylength-endrow)*100);wall();if(bewall)cout game over!endl;if(score100) cout terriblescoreendl;else if(score200) cout Just so so! scoreendl;else if (score300) cout You are OK! scoreendl;else if (score400) cout You are great!scoreendl;else coutMiracle!scoreendl;cout p0)level=score/100+1;coutThe level is levelendl;system(pause);/memset(city,0,sizeof(city);city1=7.09;city2=7.10;length=2;score=score+10;memset(coor,0,sizeof(coor);for(int i=1;i=length;i+)int k=(int)(cityi);int y=(int)(cityi-k)*100);if(i=1) coorky=2;else coorky=1;system(cls);coutwasdendl;cout score = scoreendl;cout level = levelendl;for(int i=1;i16;i+)if(i=1 | i=15)for(int j=1;j21;j+)cout-;coutendl;elsecout|;for(int j=2;j20;j+)if(coorij=1) cout+;else if(i=row & j=column) co
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年福建南平武夷有轨电车有限公司社会招聘考前自测高频考点模拟试题及答案详解参考
- 2025年福建省龙岩市武平县招聘教育卫生干部10人模拟试卷及参考答案详解
- 2025湖南澄迈县农业技术推广中心招聘见习生7人考前自测高频考点模拟试题及一套答案详解
- 2025广东广州市黄埔区人民政府萝岗街道办事处招聘政府聘员2人模拟试卷附答案详解
- 2025广西卫生职业技术学院公开招聘高层次人才22人考前自测高频考点模拟试题参考答案详解
- 2025北京海淀青龙桥社区卫生服务中心面向社会招聘2人考前自测高频考点模拟试题及答案详解(夺冠系列)
- 2025中文版运输合同范本
- 2025河北唐山市市直事业单位招聘工作人员277人模拟试卷(含答案详解)
- 2025年山东法官培训学院公开招聘人员模拟试卷及参考答案详解一套
- 2025贵州剑河县农村集体经济组织选聘职业经理人(总经理)17人考前自测高频考点模拟试题及答案详解1套
- 2025少先队基础知识题库(含答案)
- 人教版九年级物理上-各单元综合测试卷含答案共五套
- 三折页设计课件
- 防诈骗消防安全知识培训课件
- 数据标注课件
- 山河已无恙+吾辈当自强+课件-2025-2026学年高二上学期用《南京照相馆》和731上一节思政课
- 2025至2030年川渝地区成品油行业市场运行现状及未来发展预测报告
- 减肥与能量代谢课件
- 《三借芭蕉扇》课件
- 综合实践课程培训大纲
- 半导体公司内部管理制度
评论
0/150
提交评论