{"id":17343609,"url":"https://github.com/0xbe7a/mastermind","last_synced_at":"2025-06-30T23:05:31.586Z","repository":{"id":41897987,"uuid":"509757766","full_name":"0xbe7a/mastermind","owner":"0xbe7a","description":"A mastermind solver for finding optimal worst-case guesses with SIMD and multithreading support","archived":false,"fork":false,"pushed_at":"2024-03-17T00:31:30.000Z","size":1163,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-06-07T02:40:42.856Z","etag":null,"topics":["mastermind","rust","simd","webassembly"],"latest_commit_sha":null,"homepage":"https://0xbe7a.github.io/mastermind/","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/0xbe7a.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,"zenodo":null}},"created_at":"2022-07-02T13:05:32.000Z","updated_at":"2024-10-01T15:11:09.000Z","dependencies_parsed_at":"2024-03-17T02:30:47.721Z","dependency_job_id":"7f8751c2-2d6b-4fc7-a905-054ea0140a2e","html_url":"https://github.com/0xbe7a/mastermind","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/0xbe7a/mastermind","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xbe7a%2Fmastermind","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xbe7a%2Fmastermind/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xbe7a%2Fmastermind/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xbe7a%2Fmastermind/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xbe7a","download_url":"https://codeload.github.com/0xbe7a/mastermind/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xbe7a%2Fmastermind/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262864125,"owners_count":23376455,"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":["mastermind","rust","simd","webassembly"],"created_at":"2024-10-15T16:09:48.139Z","updated_at":"2025-06-30T23:05:31.552Z","avatar_url":"https://github.com/0xbe7a.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- LTeX: language=en-US --\u003e\n# A Mastermind solver for optimal worst-case guesses\nThis is a solver for the [Mastermind board\ngame](https://en.wikipedia.org/wiki/Mastermind_(board_game)) which finds guesses that minimize the maximum number of possibilities that remain after receiving the corresponding hint\n\n\u003cimg \nwidth=400\nsrc=\"https://upload.wikimedia.org/wikipedia/commons/2/2d/Mastermind.jpg\" /\u003e\n\n[*Image source*](https://commons.wikimedia.org/wiki/File:Mastermind.jpg)\n\nIt is implemented using the new [std::simd](https://doc.rust-lang.org/std/simd/index.html) SIMD Abstraction from Rust to target NEON, SSE2, AVX2 and WebAssembly SIMD from a shared implementation\n\nAdditionally, it uses [rayon](https://github.com/rayon-rs/rayon) to enable multithreading\n\nIt finds optimal worst-case guesses [^1] from all non-equivalent [^2] guesses that minimize the maximum number of remaining possibilities\n\nThe core solver is implemented in [libmastermind](https://github.com/0xbe7a/mastermind/blob/main/libmastermind/src/positions.rs) alongside a CLI-Solver and a Web frontend \n\n# Play\n[https://0xbe7a.github.io/mastermind/](https://0xbe7a.github.io/mastermind/)\n\n_NOTE: No fallback for browsers without WASM and WebAssembly SIMD has been provided (Not Safari and Firefox is currently flaky)_\n\n## Building the Application\n1. Run ```nix develop``` on Nix (or)\n   1. install rust-nightly with the ```wasm32-unknown-unknown``` target and ```rust-src``` component\n   2. install wasm-pack\n   3. install npm\n   4. target the native CPU Features using ```export RUSTFLAGS=\"-C target-cpu=native\"```\n2. To build the CLI-Solver use ```cargo build --release```\n3. To build the WebApp\n   1. Go to \"web/www\"\n   2. use ```npm install```\n   3. build the application with ```npm run build```\n\n## References:\n[^1]: Knuth, D. E. (1976). The computer as master mind. Journal of Recreational Mathematics, 9(1), 1-6.\n\n[^2]: Ville, G. (2013). An optimal mastermind (4, 7) strategy and more results in the expected case. arXiv preprint arXiv:1305.1010.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xbe7a%2Fmastermind","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xbe7a%2Fmastermind","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xbe7a%2Fmastermind/lists"}