{"id":13683028,"url":"https://github.com/Vlamonster/maze_solver_rust","last_synced_at":"2025-04-30T10:30:35.760Z","repository":{"id":154403440,"uuid":"586265981","full_name":"Vlamonster/maze_solver_rust","owner":"Vlamonster","description":"Generate, display and solve mazes in an animated way in the terminal.","archived":false,"fork":false,"pushed_at":"2023-01-12T20:01:32.000Z","size":282,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-08-02T13:34:49.899Z","etag":null,"topics":["animation","maze-generator","maze-solver","rust","terminal"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/Vlamonster.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}},"created_at":"2023-01-07T14:32:27.000Z","updated_at":"2024-06-23T15:35:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"9bea3851-2278-4c6a-861a-5110aa889947","html_url":"https://github.com/Vlamonster/maze_solver_rust","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vlamonster%2Fmaze_solver_rust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vlamonster%2Fmaze_solver_rust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vlamonster%2Fmaze_solver_rust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vlamonster%2Fmaze_solver_rust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Vlamonster","download_url":"https://codeload.github.com/Vlamonster/maze_solver_rust/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224206372,"owners_count":17273448,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["animation","maze-generator","maze-solver","rust","terminal"],"created_at":"2024-08-02T13:01:57.922Z","updated_at":"2024-11-12T02:32:53.234Z","avatar_url":"https://github.com/Vlamonster.png","language":"Rust","funding_links":[],"categories":["Rust","\u003ca name=\"animation\"\u003e\u003c/a\u003eAnimation"],"sub_categories":[],"readme":"# How to Run\n\n```\nUsage: maze_solver.exe [OPTIONS] \u003c--generator \u003cGENERATOR\u003e|--input \u003cINPUT\u003e\u003e [ROWS] [COLUMNS]\n\nArguments:\n  [ROWS]     Number of rows to draw [default: 16]\n  [COLUMNS]  Number of columns to draw [default: 48]\n\nOptions:\n  -g, --generator \u003cGENERATOR\u003e  Generator used [possible values: depth_first_search, breadth_first_search, kruskal]\n  -i, --input \u003cINPUT\u003e          Input path used\n  -s, --solver \u003cSOLVER\u003e        Solver used. If Some, then the generator will run with a delay of 0 [possible values: depth_first_search, a_star]\n  -t, --trace                  Flag to enable drawing visited cells\n  -d, --delay \u003cDELAY\u003e          Number of milliseconds between animation [default: 25]\n  -h, --help                   Print help information\n  -V, --version                Print version information\n```\n\nHere are some examples:\n\n```\n# Animate generating a 10 by 12 maze using the depth-first seach generator.\ncargo run --release -- 10 12 -g depth_first_search\n\n# Animate generating a 16 by 48 maze using the depth-first seach generator and a delay of 0ms (instant).\ncargo run --release -- -g depth_first_search -d 0\n\n# Animate solving a 16 by 48 kruskal maze using the depth-first search solver.\ncargo run --release -- -g kruskal -s depth_first_search\n\n# Animate solving a 16 by 48 kruskal maze with trace using the depth-first search solver.\ncargo run --release -- -g kruskal -s depth_first_search -t\n\n# Animate solving the medium sized example using the depth-first search solver.\ncargo run --release -- -i examples/medium.maze -s depth_first_search\n```\n\nI tested that this works on at least Windows 10, Ubuntu and macOS.\n\n# Generators\n\nThe following generators are included:\n\u003cdetails\u003e\u003csummary\u003eRandomized depth-first search.\u003c/summary\u003e\n\n![](examples/dfs.gif)\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eRandomized breadth-first search.\u003c/summary\u003e\n\n![](examples/bfs.gif)\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eKruskal's algorithm.\u003c/summary\u003e\n\n![](examples/kruskal.gif)\n\u003c/details\u003e\n\n# Solvers\n\nThe following solvers are included:\n\u003cdetails\u003e\u003csummary\u003eDepth-first search\u003c/summary\u003e\n\n![](examples/dfs_solver.gif)\n\u003c/details\u003e\n\u003cdetails\u003e\u003csummary\u003eA*\u003c/summary\u003e\n\nNo gif yet.\n\u003c/details\u003e\n\n\n# Note on Design\n\nIt was important to me that large mazes could be drawn in a limited space, which meant that some thought had to be given\non how the maze should be represented. A simple (yet effective) representation would look like this:\n\n```\n+ +-+   [N, H]     \n| | |   [V, V, V]     \n+ +-+   [N, H]\n|   |   [V, N, V]\n+-+ +   [H, N]\n\nH: Horizontal,\nV: Vertical,\nN: None,\n```\n\nThis is 5x5 character matrix to represent a 2x2 maze. We can do better by combining the vertical and horizontal walls\ninto the same line:\n\n```\n_ ___   [H, N, H, H, H]\n| |_|   [V, N, H, V, H]\n|__ |   [V, H, N, N, V]\n\nH: Horizontal,\nV: Vertical,\nN: None,\n```\n\nThis gives us a 3x3 character matrix, which is a lot better! Furthermore, if replace the underscores with underlines,\nthen we can actually draw characters inside the cells. This allows for very nice looking animations.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FVlamonster%2Fmaze_solver_rust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FVlamonster%2Fmaze_solver_rust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FVlamonster%2Fmaze_solver_rust/lists"}