- 1、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
递归法和回溯法(Recursive method and backtracking method) VC6 does not have this function, and the 219 character of the maze can not be displayed in the 32 bit console program of the operating system that uses Chinese page number. If you want to achieve the gotoxy () function in VC6, you have to use API, for a simple program is not necessary, so it is written with TC2, suddenly changed to C language, there is still not suited. #include stdio.h Typedef, struct, hero, {int, x, y, face,}, HERO; Void, set_hero (HERO*, h, int, x, int, int, face) {h-x=x; h-y=y; Y; h-face=face;} Void go (HERO*, H) {if (h-face%2) h-x+=2-h-face; else h-y+=h-face-1;} Void goleft (HERO*, H) {if (h-face%2) h-y+=h-face-2; else h-x+=h-face-1;} Void turnleft (HERO*, H) {h-face= (h-face+3)%4;} Void turnright (HERO*, H) {h-face= (h-face+1)%4;} Void print_hero (HERO*, h, int, b) { Gotoxy (h-x + 1, h-y + 1); If (b) { Switch (h-face) { Case, 0:, printf (%c, 24); break; Case, 1:, printf (%c, 16); break; Case, 2:, printf (%c, 25); break; Case, 3:, printf (%c, 27); break; Default: break; } } Else printf (); } Int maze[10][10] = { 0, 0, 0, 1, 0, 0,, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1,, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0,, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1,, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1,, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1,, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1,, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0,, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0,, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0,, 0, 0, 0, 0 }; Void, print_maze () { Int, I, j; For (I = 0; I 10; i++) { For (J = 0; J 10; j++) { If (maze[i][j]) printf (%c, 219); Else printf (); } Printf (\n); } } Int gomaze (HERO* h) { HERO t = *h; int i; For (I = 0; I 2; t = *h) { Print_hero (h, 1); sleep (1); go (t); If (t.x t.x = 0 10 0 T.Y T.Y = 10 maze[t.y][t.x]!) { Print_hero (h, 0); go (H); / * * / go ahead can walk If (h-x = 9 and h-y = = 9) return 1; goleft (a t). if (h - x = = 0 h - y = = 0) + +. if (t.x = 0 t.y t.x 10 = 0 10 t.y. t.y. [] []) turnleft t.x (h); / * * / 左方无墙向左转 } (h) will turnright 前方不可走
您可能关注的文档
- 我的邮箱不是垃圾箱 垃圾邮件防范策略(My mailbox is not spam spam prevention policy).doc
- 我非英雄 盖聂评析(I am not a hero of Gagne).doc
- 我国LED封装业的现状与未来发展(Present situation and future development of LED packaging industry in China).doc
- 我国的环境问题及现状(Environmental problems and current situation in China).doc
- 我国发展煤制烯烃产业的必要性和可行性探讨[1](Discussion on the necessity and feasibility of developing coal to olefins industry in China [1]).doc
- 我国公路发展状况(Highway development in China).doc
- 我国旅游业发展中的环境问题用其对策(The environmental problems in the development of China's tourism industry and Their Countermeasures).doc
- 我国农产品绿色营销策略(Green marketing strategy of agricultural products in China).doc
- 我成功了(I made it!).doc
- 我国能源结构的调整_数据更新至07年(The adjustment of China's energy structure _ data update to 07 years).doc
- 钓鲢、鳙鱼总结(Fishing carp, bighead summary).doc
- 钓鱼几种调漂找底的方法(How to adjust the drift to find the bottom of fishing).doc
- 鼎湖山听泉(Dinghu mountain listening spring).doc
- 董事长辞职转管理任副职,春兰空调再现高层变动(The chairman resigned to management office deputy, Chunlan reproduce high-level changes).doc
- 读懂它的财务报表的最基本要求(Read the basic requirements of its financial statements).doc
- 鳄鱼龟的繁殖和孵化(Breeding and hatching of alligator turtles).doc
- 防盗门定制(Custom door).doc
- 防火墙 讲解(Firewall explanation).doc
- 防雷接地规范(Lightning protection grounding code).doc
- 道路照明设计(Road lighting design).doc
文档评论(0)