{"id":18439064,"url":"https://github.com/demonstrandum/crystal_maze","last_synced_at":"2025-04-07T21:32:11.478Z","repository":{"id":96636237,"uuid":"92108116","full_name":"Demonstrandum/crystal_maze","owner":"Demonstrandum","description":"A* Path finding for PNG mazes, from Ruby now in Crystal. Using StumpyPNG","archived":false,"fork":false,"pushed_at":"2020-02-04T20:49:23.000Z","size":3364,"stargazers_count":19,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-23T00:51:19.957Z","etag":null,"topics":["a-star","algorithm","crystal","labyrinth","maze","maze-solver","png","solver","stumpy"],"latest_commit_sha":null,"homepage":"","language":"Crystal","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Demonstrandum.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2017-05-22T23:26:26.000Z","updated_at":"2020-02-27T16:31:29.000Z","dependencies_parsed_at":"2024-01-14T19:13:26.130Z","dependency_job_id":"c7ad85fe-7a77-4b73-8047-292f66e88c8f","html_url":"https://github.com/Demonstrandum/crystal_maze","commit_stats":null,"previous_names":["demonstrandum/crystal-maze"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Demonstrandum%2Fcrystal_maze","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Demonstrandum%2Fcrystal_maze/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Demonstrandum%2Fcrystal_maze/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Demonstrandum%2Fcrystal_maze/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Demonstrandum","download_url":"https://codeload.github.com/Demonstrandum/crystal_maze/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247732633,"owners_count":20986893,"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":["a-star","algorithm","crystal","labyrinth","maze","maze-solver","png","solver","stumpy"],"created_at":"2024-11-06T06:23:14.265Z","updated_at":"2025-04-07T21:32:08.350Z","avatar_url":"https://github.com/Demonstrandum.png","language":"Crystal","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Crystal-Maze\n\nA* Path finding for PNG mazes, from Ruby now in Crystal! Using StumpyPNG!\nNow ×40 faster than its Ruby counterpart: [A-Star](https://github.com/Demonstrandum/A-Star)\n\n![Example-400x400maze](mazes/400-example.png)\n\n## Installation\nBuild it from source:\nClone and enter repository:\n```shell\ngit clone https://github.com/Demonstrandum/Crystal-Maze.git \u0026\u0026 cd Crystal-Maze\n```\nthen install dependencies with [`shards`](https://github.com/crystal-lang/shards) ([StumpyPNG](https://github.com/stumpycr/stumpy_png)):\n```shell\nshards install\n```\nand run the make file:\n```shell\nmake\nsudo make install clean\n#sudo make uninstall # to remove the program\n```\n\n## Usage\nTo run the program itself:\n```shell\nmaze ~/Pictures/yourImage.png\n```\nThis will solve the maze and make and image with the suffix \"-solved\"\u003cbr /\u003e\ne.g. `yourImage-solved.png` in the same location as the input image.\n\n\nYou can also add optional arguments of heuristic distance type, verbosity and wheather to draw nodes or not. For heuristic distance just type `euclidean` or `manhattan`  as argument for distance calculation type, these are the only two currently supported. Showing nodes is done with the argument `--show-nodes` and for verbosity (prints the nodes of the final path) either `-v`, `verbose` or `--verbose`.\n\nFor example:\n```shell\nmaze euclidean -v hipMaze.png --show-nodes\n```\n\n### GIFs\n![Maze being solved](mazes/200-solved.gif)\n\u003e Maze being mapped out by flood and then solved with ***A****\n\nYou can animate the solving with the `--gif` argument, this looks better with `--show-nodes` as you can see the nodes being placed and spreading. e.g.\n```shell\nmaze mazes/50-maze.png --show-nodes --gif\n```\nThe gif will most likely be very slow, so you can drop some frames to speed it up:\n```shell\nmaze mazes/normal.png --show-nodes --gif --gif-speed 14\n```\nThe above means: only keep *every 14th* frame.\n\nwhich generates `mazes/50-maze-solved.gif`\n**Be careful**, when making GIFs with large mazes, the program will use *a lot* of memory and may freeze your computer!\n\n## Maze PNG requirements\nThe start and end points of the maze must be white and be from top or left to bottom or right, if this is not true, then it means the maze has a black border, in which case it will find a green pixel (doesn't have to be perfect green) and sets that as the start point and then finds a red pixel (doesn't have to be perfect red) and sets that as the end point.\n\n---\n\nP.S. It's highly recommended that the maze's walls and paths are 1 pixel wide as the program draws and reads the paths as one pixel.  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdemonstrandum%2Fcrystal_maze","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdemonstrandum%2Fcrystal_maze","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdemonstrandum%2Fcrystal_maze/lists"}