{"id":21034697,"url":"https://github.com/lpenz/codingame-the-labyrinth","last_synced_at":"2025-08-28T12:20:49.333Z","repository":{"id":38330050,"uuid":"403159691","full_name":"lpenz/codingame-the-labyrinth","owner":"lpenz","description":"Solution for codingame's The Labyrinth in rust","archived":false,"fork":false,"pushed_at":"2024-05-28T21:47:00.000Z","size":132,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-17T17:50:42.656Z","etag":null,"topics":["codingame","codingame-solutions","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lpenz.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,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-09-04T21:31:16.000Z","updated_at":"2024-05-28T21:47:04.000Z","dependencies_parsed_at":"2024-05-29T00:17:18.133Z","dependency_job_id":"9b1cd9e7-d527-468c-92a1-fd960b2e2136","html_url":"https://github.com/lpenz/codingame-the-labyrinth","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lpenz/codingame-the-labyrinth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpenz%2Fcodingame-the-labyrinth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpenz%2Fcodingame-the-labyrinth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpenz%2Fcodingame-the-labyrinth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpenz%2Fcodingame-the-labyrinth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lpenz","download_url":"https://codeload.github.com/lpenz/codingame-the-labyrinth/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpenz%2Fcodingame-the-labyrinth/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272498248,"owners_count":24944819,"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","status":"online","status_checked_at":"2025-08-28T02:00:10.768Z","response_time":74,"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":["codingame","codingame-solutions","rust"],"created_at":"2024-11-19T13:08:01.888Z","updated_at":"2025-08-28T12:20:49.303Z","avatar_url":"https://github.com/lpenz.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![CI](https://github.com/lpenz/codingame-the-labyrinth/actions/workflows/ci.yml/badge.svg)](https://github.com/lpenz/codingame-the-labyrinth/actions/workflows/ci.yml)\n[![coveralls](https://coveralls.io/repos/github/lpenz/codingame-the-labyrinth/badge.svg?branch=main)](https://coveralls.io/github/lpenz/codingame-the-labyrinth?branch=main)\n\n\n# codingame-the-labyrinth\n\nThis repository has my solution for [The Labyrinth] exercise of\n[Codingame], made in rust.\n\n\n## Overall strategy\n\nThis is a grid-based exercise, where we have to find and go over a\ntarget coordinate, and then go back to the start of the map as fast as\npossible.\n\nThe overall strategy is pretty simple, and can be divided in the\nfollowing phases:\n- *discovery*: explore the \"unknown\" coordinates of the map, using a\n  path-finding algorithm to move towards the closest \"unkown\"\n  tile. Active until we find a path to the \"control room\".\n- *activation*: after we find the control room, we use path-finding to\n  move onto it.\n- *escape*: use path-finding to get the optimal path to the starting\n  position.\n\n\nThis repository just uses BFS for all path-finding. I was expecting to\nhit a situation where the *discovery* phase would not explore enough\nfor us to find an optimal path for the *escape* phase, but that didn't\nhappen.\n\n\n## File structure\n\nThis repository follows my usual file structure for codingame\nchallenges (both puzzles and AI):\n- [src/core.rs](src/core.rs): the core datastructures and\n  functionality.\n- [src/input.rs](src/input.rs): input parsing, inclusing the `FromStr`\n  trait implementations.\n- [src/error.rs](src/error.rs): error enum. We can just `unwrap()`\n  everything, but I'd rather exercise the best practices.\n- [src/entrypoint.rs](src/entrypoint.rs): the main loop, where the\n  strategy is implemented.\n- [src/sqrid.rs](src/sqrid.rs): this file is imported from the\n  [sqrid](https://github.com/lpenz/sqrid) square-grid library. It has\n  the implementation of all the grid-related functions, in an\n  easy-to-import format. I'm using this in other square-grid related\n  puzzles and AI bots.\n\n\n[Codingame]: https://www.codingame.com/\n[The Labyrinth]: https://www.codingame.com/ide/puzzle/the-labyrinth\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flpenz%2Fcodingame-the-labyrinth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flpenz%2Fcodingame-the-labyrinth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flpenz%2Fcodingame-the-labyrinth/lists"}