{"id":16692589,"url":"https://github.com/pencilcaseman/mastermind","last_synced_at":"2025-09-05T12:37:13.793Z","repository":{"id":221390673,"uuid":"754247561","full_name":"Pencilcaseman/mastermind","owner":"Pencilcaseman","description":"The game Mastermind implemented in Rust, with optimal algorithms to play the game.","archived":false,"fork":false,"pushed_at":"2024-02-07T22:04:02.000Z","size":10,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-20T18:11:30.678Z","etag":null,"topics":["adversarial-search","command-line","game","mastermind","mastermind-game","optimisation","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/Pencilcaseman.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}},"created_at":"2024-02-07T17:25:35.000Z","updated_at":"2024-08-07T04:34:34.000Z","dependencies_parsed_at":"2024-11-19T14:42:53.291Z","dependency_job_id":"12e82bc8-aa86-4387-b3b9-1cb755a0e65f","html_url":"https://github.com/Pencilcaseman/mastermind","commit_stats":null,"previous_names":["pencilcaseman/mastermind"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pencilcaseman%2Fmastermind","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pencilcaseman%2Fmastermind/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pencilcaseman%2Fmastermind/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pencilcaseman%2Fmastermind/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Pencilcaseman","download_url":"https://codeload.github.com/Pencilcaseman/mastermind/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243495487,"owners_count":20299921,"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":["adversarial-search","command-line","game","mastermind","mastermind-game","optimisation","rust"],"created_at":"2024-10-12T16:27:41.789Z","updated_at":"2025-03-13T22:41:26.319Z","avatar_url":"https://github.com/Pencilcaseman.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mastermind\nThe game Mastermind implemented in Rust, with optimal algorithms to play the game.\n\n## Compiling and Running\nWith a modern version of Rust installed, clone the repository and run `cargo run` to run the program.\n\n```sh \ngit clone https://github.com/Pencilcaseman/mastermind.git \ncd mastermind \ncargo build # Optional. Cargo run will compile the code\ncargo run # Add `--release` to enable optimisations (much faster)\n```\n\n## Using the Program \n\n### Interacting with the Program \n\n#### From the Command Line \n\nYou can pick a mode from the command line by specifying additional arguments to the program:\n\n```\nUsage: mastermind [OPTIONS]\n\nOptions:\n  -t, --target\n  -c, --correctness\n  -b, --beat\n  -a, --adversarial\n  -h, --help         Print help\n  -V, --version      Print version\n```\n\nNote that to pass arguments via Cargo, you can use `cargo run -- --help`, for example (note the `--` with spaces either side). \n\n#### From Inside the Program \n\nThere is a menu you can use in the program, with options to select different game modes.\n\n```\n ======= Menu =======\n- 1 Play With Target\n- 2 Check Correctness\n- 3 Beat Game\n- 4 Adversarial\n\u003e\u003e\u003e\n```\nEnter the mode you'd like (`2`, for example, to run `Check Correctness`) and press enter. Type `exit` to quit. \n\n### Game Modes\n#### Play with Target \nThe user enters a target, and the program outputs the best possible guess you can make at any given stage. You can enter any guess, however, and the game will play out as expected. \n\n#### Check Correctness\n\nFor every possible target set, run the optimal algorithm and check that it does, indeed, find the correct solution. It also records the number of guesses necessary to find the solution.\n\nIt is recommended that you only run this mode in `--release` configurations, since it can be quite slow. If I have time, I'll see if I can optimise the algorithm to make it faster.\n\n#### Beat Game \nFor use against another player -- make the guess provided by the program and enter the set of pegs returned (black/white or full/partial matches). The program will continue to tell you the optimal move to make until you win the game.\n\n#### Adversarial\nFor you to play against the computer (on hard mode...). You make guesses and see how quickly you can guess the computer's chosen target.\n\nIt's also fun to have the program open in two terminal windows, watching the optimal algorithm (`Beat Game`) play against the optimal 'guess' (`Adversarial`).\n\n(Spoiler: The computer will make your life as difficult as possible (mathematically))\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpencilcaseman%2Fmastermind","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpencilcaseman%2Fmastermind","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpencilcaseman%2Fmastermind/lists"}