




免费预览已结束,剩余1页可下载查看
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
#include#includeint i,j,steps = 0,gk = 1;char command,t,m = 0,n = 0;int map_1811,map811 = 0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,1,0,0,1,1,1,1,1,0,0,0,1,0,0,6,0,0,4,1,0,0,0,1,3,0,2,0,0,4,1,0,0,0,1,0,0,1,1,1,1,1,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0;int map_2811 = 0,0,0,1,1,1,1,0,0,0,0,0,0,0,1,4,0,1,0,0,0,0,1,1,1,1,0,0,1,1,0,0,0,1,0,0,0,3,2,0,1,0,0,0,1,0,1,1,0,0,0,1,0,0,0,1,0,6,0,0,0,0,1,1,0,0,1,1,1,1,0,0,0,4,1,0,0,0,0,0,1,1,1,1,1,1,0,0;int map_3811 = 0,0,0,1,1,1,1,0,0,0,0,0,0,0,1,4,4,1,0,0,0,0,1,1,1,1,0,0,1,1,0,0,0,1,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,1,1,0,0,1,1,1,0,1,6,2,0,1,0,0,0,0,1,0,0,3,0,0,1,0,0,0,0,1,1,1,1,1,1,1,0,0;typedef struct positionint x;int y;location;location agg3;/全部通过void clearance()if(mapagg1.xagg1.y = 5&mapagg2.x + nagg2.y + m = 5&gk = 3)printf(你赢了!n);system(pause);exit(0);/判断是否通过void control_adopt()if(mapagg1.xagg1.y = 5&mapagg2.x + nagg2.y + m = 5)if(gk != 3)for(i = 0;i 8;i+)for(j = 0;j 11;j+)mapij = map_2ij;map_2ij = map_3ij;map_1ij = mapij;gk+;steps = 0;/重新开始void control_reset(char reset_1)if(reset_1 = f)for(i = 0;i 8;i+) for(j = 0;j 11;j+)mapij = map_1ij;steps = 0;/结束void control_end(char end_0)if(end_0 = t)exit(0);/控制方向 + 箱子堵住陷阱void control_direction(char direction_)if(direction_ = d|direction_ = w|direction_ = a|direction_ = s)if(direction_ = d)m = 1;if(direction_ = a)m = -1;if(direction_ = w)n = -1;if(direction_ = s)n = 1;if(agg0.x + n = agg1.x&(agg0.y + m) = agg1.y&mapagg1.x + nagg1.y + m != 1&mapagg1.xagg1.y != 5)if(mapagg1.x + nagg1.y + m = 4)mapagg1.xagg1.y = 0;mapagg1.x + nagg1.y + m = 5;agg1.y = agg1.y + m;agg1.x = agg1.x + n;elset = mapagg1.x + nagg1.y + m;mapagg1.x + nagg1.y + m = mapagg1.xagg1.y;mapagg1.xagg1.y = t;agg1.y = agg1.y + m;agg1.x = agg1.x + n;/第二个箱子的判断条件if(agg0.x + n = agg2.x&(agg0.y + m) = agg2.y&mapagg2.x + nagg2.y + m != 1&mapagg2.xagg2.y != 5)if(mapagg2.x + nagg2.y + m = 4)mapagg2.xagg2.y = 0;mapagg2.x + nagg2.y + m = 5;agg2.y = agg2.y + m;agg2.x = agg2.x + n;elset = mapagg2.x + nagg2.y + m;mapagg2.x + nagg2.y + m = mapagg2.xagg2.y;mapagg2.xagg2.y = t;agg2.y = agg2.y + m;agg2.x = agg2.x + n;if(mapagg0.x + nagg0.y + m = 0)t = mapagg0.x + nagg0.y + m;mapagg0.x + nagg0.y + m = mapagg0.xagg0.y;mapagg0.xagg0.y = t;agg0.y = agg0.y + m;agg0.x = agg0.x + n;steps+;m = 0;n = 0;/输出,寻找1,2,3void control_output()printf(关卡%d:n,gk);printf(步数:%dn,steps);for(i = 0;i 8;i+)for(j = 0;j 11;j+)if(mapij = 1)printf();if(mapij = 0)printf();if(mapij = 2)printf();agg1.x = i;agg1.y = j;if(mapij = 3)printf();agg0.x = i;agg0.y = j;if(mapij = 4)printf();if(mapij = 5)printf();if(mapij = 6)printf();agg2.x = i;agg2.y = j;printf(n);printf(w,a,s,d控制方向,t退出游戏,f重新开始!n);/输入指令void input_command()while(1)scanf(%c,&command);if(command = w|command = a|command = s|command = d|command = t|command = f)break;main()for(i = 0;i 8;i+)for(j = 0;j 12;j+)map_1ij = mapij;while(1)control_output();input_command();control_dir
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025医学新生儿肺炎诊治考试题目及答案
- 2025医学四肢骨折处理考试题目及答案
- 三年级语文上册 第三单元 快乐读书吧:在那奇妙的王国里说课稿 新人教版
- 2025成年人政治权力结构考试题目及答案
- 2025至2030建筑结构用钢板市场行业市场深度研究及发展前景投资可行性分析报告
- 五年级数学(小数乘除法)计算题专项练习及答案汇编
- 2025版企业食堂蔬菜批量采购合同样本
- 2025年度环境监测与污染防治技术服务合同
- 2025版食品工业用酶代加工技术合同范本
- 2025版通信工程保险理赔服务合同
- 人工智能提示词工程师试题含答案
- 200兆瓦风电项目清单及报价表
- T/CHES 100-2023水质高锰酸盐指数的测定自动氧化还原滴定法
- 结直肠癌导致急性肠梗阻外科治疗中国专家共识(2025版)课件
- (人教版)初中英语九年级全册 各单元测试卷及答案共十四套
- 售后服务转移合同协议
- 廊坊市广阳区2025年小升初素养数学检测卷含解析
- 高值耗材点评制度
- 附件6工贸高风险企业高危领域较大以上安全风险管控清单
- 人教版2024-2025学年七年级数学上册教学计划(含进度表)
- (高清版)DB11∕T687-2024公共建筑节能设计标准
评论
0/150
提交评论