{"id":19368338,"url":"https://github.com/jerryym/mazer","last_synced_at":"2026-06-11T01:31:32.243Z","repository":{"id":154877620,"uuid":"348177647","full_name":"Jerryym/Mazer","owner":"Jerryym","description":"走出迷宫","archived":false,"fork":false,"pushed_at":"2021-03-16T06:29:44.000Z","size":426,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-24T13:48:35.302Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Jerryym.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-16T01:39:41.000Z","updated_at":"2021-03-16T06:29:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"8a4ac1a5-5d6d-41c4-826c-2767535c695d","html_url":"https://github.com/Jerryym/Mazer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Jerryym/Mazer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jerryym%2FMazer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jerryym%2FMazer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jerryym%2FMazer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jerryym%2FMazer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jerryym","download_url":"https://codeload.github.com/Jerryym/Mazer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jerryym%2FMazer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34178819,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-10T02:00:07.152Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T08:06:11.314Z","updated_at":"2026-06-11T01:31:32.228Z","avatar_url":"https://github.com/Jerryym.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Mazer 走出迷宫\n\n#### 算法\n- 使用右手准则算法\n\n#### 设计\n- 迷宫类（Mazemap）\n\u003cbr/\u003e数据成员：墙壁字符、通道字符、迷宫数组（迷宫的尺寸：长 宽）\u003c/br\u003e\n\u003cbr/\u003e 成员函数：构造函数、数据封装函数、迷宫绘制函数、迷宫边界检查函数\u003c/br\u003e\n\u003cbr/\u003e构造函数：默认构造，带参数构造\u003c/br\u003e\n\u003cbr/\u003e数据封装函数：set_wall、set_road、设置默认地图、设置自定义地图\u003c/br\u003e\n\u003cbr/\u003e迷宫绘制函数：输出打印函数、获取通道字符\u003c/br\u003e\n\u003cbr/\u003e迷宫边界检查函数：墙壁检查、出口检查函数\u003c/br\u003e\n\n- 人类(Person)\n\u003cbr/\u003e数据成员：人的字符、人的朝向、人的当前位置、人前一个所处位置、人的速度\u003c/br\u003e\n\u003cbr/\u003e成员函数：构造函数、数据封装函数、向不同方向前进的函数、转弯函数、开始函数\u003c/br\u003e\n\u003cbr/\u003e构造函数：默认构造、带参数构造\u003c/br\u003e\n\u003cbr/\u003e数据封装函数：人的字符，人的当前位置、人的当前朝向、人的速度\u003c/br\u003e\n\u003cbr/\u003e向不同方向前进的函数：朝北、朝南、朝西、朝东、沿当前方向前进\u003c/br\u003e\n\u003cbr/\u003e转弯函数：左转、右转\u003c/br\u003e\n\u003cbr/\u003e开始函数\u003c/br\u003e\n\n#### 运用到的知识点\n- static：在内存中是以固定地址存放的，在整个程序运行期间都有效\n- 类中静态数据成员需在类外初始化\n- 常成员函数\n- gotoxy(int x,int y)\n  - 需要加入Windows.h头文件\n  - 函数作用：光标直接跳到第x列y行\n  - 参数表含义：第x列y行\n  - 代码样例：\n  ```\n  void MazePerson::gotoxy(int x, int y)//光标直接跳到第x列y行\n  {\n    COORD cd;\n    cd.X = x;\n    cd.Y = y;\n    SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), cd);\n  }\n  ```\n- Sleep()\n  - 需要加入Windows.h头文件\n  - 函数作用：延时\n  - 毫秒为单位\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjerryym%2Fmazer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjerryym%2Fmazer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjerryym%2Fmazer/lists"}