{"id":16201906,"url":"https://github.com/di-void/minesweeper-annotate-rs","last_synced_at":"2025-08-23T02:09:45.217Z","repository":{"id":243311269,"uuid":"812079469","full_name":"di-void/minesweeper-annotate-rs","owner":"di-void","description":"I'm yet to see a solution this complex, contrived and comprehensive.","archived":false,"fork":false,"pushed_at":"2024-06-12T09:56:38.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-13T20:35:23.802Z","etag":null,"topics":[],"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/di-void.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":"2024-06-07T23:10:44.000Z","updated_at":"2024-06-12T09:56:41.000Z","dependencies_parsed_at":"2024-06-12T12:14:05.019Z","dependency_job_id":null,"html_url":"https://github.com/di-void/minesweeper-annotate-rs","commit_stats":null,"previous_names":["di-void/minesweeper-annotate-rs"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/di-void%2Fminesweeper-annotate-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/di-void%2Fminesweeper-annotate-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/di-void%2Fminesweeper-annotate-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/di-void%2Fminesweeper-annotate-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/di-void","download_url":"https://codeload.github.com/di-void/minesweeper-annotate-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247712683,"owners_count":20983679,"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":[],"created_at":"2024-10-10T09:44:51.086Z","updated_at":"2025-04-07T18:46:33.017Z","avatar_url":"https://github.com/di-void.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Minesweeper\n\nWelcome to Minesweeper on Exercism's Rust Track.\nIf you need help running the tests or submitting your code, check out `HELP.md`.\n\n## Introduction\n\n[Minesweeper][wikipedia] is a popular game where the user has to find the mines using numeric hints that indicate how many mines are directly adjacent (horizontally, vertically, diagonally) to a square.\n\n[wikipedia]: https://en.wikipedia.org/wiki/Minesweeper_(video_game)\n\n## Instructions\n\nYour task is to add the mine counts to empty squares in a completed Minesweeper board.\nThe board itself is a rectangle composed of squares that are either empty (`' '`) or a mine (`'*'`).\n\nFor each empty square, count the number of mines adjacent to it (horizontally, vertically, diagonally).\nIf the empty square has no adjacent mines, leave it empty.\nOtherwise replace it with the adjacent mines count.\n\nFor example, you may receive a 5 x 4 board like this (empty spaces are represented here with the '·' character for display on screen):\n\n```text\n·*·*·\n··*··\n··*··\n·····\n```\n\nWhich your code should transform into this:\n\n```text\n1*3*1\n13*31\n·2*2·\n·111·\n```\n\n## Performance Hint\n\nAll the inputs and outputs are in ASCII.\nRust `String`s and `\u0026str` are utf8, so while one might expect `\"Hello\".chars()` to be simple, it actually has to check each char to see if it's 1, 2, 3 or 4 `u8`s long.\nIf we know a `\u0026str` is ASCII then we can call `.as_bytes()` and refer to the underlying data as a `\u0026[u8]` (byte slice).\nIterating over a slice of ASCII bytes is much quicker as there are no codepoints involved - every ASCII byte is one `u8` long.\n\nCan you complete the challenge without cloning the input?\n\n## Source\n\n### Created by\n\n- @EduardoBautista\n\n### Contributed to by\n\n- @ashleygwilliams\n- @coriolinus\n- @cwhakes\n- @EduardoBautista\n- @efx\n- @ErikSchierboom\n- @ffflorian\n- @IanWhitney\n- @kytrinyx\n- @lutostag\n- @mkantor\n- @nfiles\n- @petertseng\n- @rofrol\n- @stringparser\n- @workingjubilee\n- @xakon\n- @ZapAnton","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdi-void%2Fminesweeper-annotate-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdi-void%2Fminesweeper-annotate-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdi-void%2Fminesweeper-annotate-rs/lists"}