{"id":20106748,"url":"https://github.com/ravbug/mastermind","last_synced_at":"2025-03-02T17:48:35.965Z","repository":{"id":117437640,"uuid":"242219291","full_name":"Ravbug/Mastermind","owner":"Ravbug","description":"Mastermind, written in Python/Pygame in 2010","archived":false,"fork":false,"pushed_at":"2020-02-21T22:10:42.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-13T05:10:33.814Z","etag":null,"topics":["easygui","mastermind-game","pygame","python2","python3"],"latest_commit_sha":null,"homepage":null,"language":"Python","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/Ravbug.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":"2020-02-21T19:53:04.000Z","updated_at":"2024-06-19T13:15:10.000Z","dependencies_parsed_at":"2023-03-14T07:16:01.909Z","dependency_job_id":null,"html_url":"https://github.com/Ravbug/Mastermind","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ravbug%2FMastermind","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ravbug%2FMastermind/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ravbug%2FMastermind/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ravbug%2FMastermind/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ravbug","download_url":"https://codeload.github.com/Ravbug/Mastermind/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241549087,"owners_count":19980475,"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":["easygui","mastermind-game","pygame","python2","python3"],"created_at":"2024-11-13T17:54:41.279Z","updated_at":"2025-03-02T17:48:35.916Z","avatar_url":"https://github.com/Ravbug.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mastermind\nIn 2010 I wrote a version of Mastermind in Python and Pygame. I found it on an old computer and decided to publish it.\n\n## How to play Mastermind\nMastermind is a code-breaking game. One player decides a secret code of four colors, and the other \nplayer has ten chances to crack the code. The board is arranged in ten rows of 8 pin-holes. The codebreaker uses the larger\nholes while the codemaker uses the smaller holes. In this version, the computer plays the role of the codemaker, and you play the role of the codebreaker.\n\nThe codemaker chooses a four-color code out of any of the following colors: red, orange, yellow, green, blue, and purple. \nThe codemaker may optionally use a blank space as one of the items in the code, and can re-use the same color multiple times. \nIn this version of the game, a dialog box allows the player to choose if they want to allow the computer to include blank spaces\nin its code.\n\nOnce the codemaker has selected the code, the codebreaker attempts to figure it out. \nThe codebreaker places the large colored pegs into the large holes (see controls below). \nOnce the codebreaker is satisfied with their guess, the codemaker \"grades\" them by filling the smaller holes with \npegs of two colors.\n\n- Red peg: One color is correct and is in the correct location.\n- White peg: One color is correct but is not in the correct location.\n- Red stripe across holes: None of the colors are correct.\n\nThe order of the pegs in the grading circles is not necessariliy the same as the pegs in your guess. \nThe codebreaker wins if they can guess the correct code (signified with all red in the grading area) within 10 guesses. \n\n## Controls\nThis game has very simple keyboard controls. \n- `Left arrow`: Move the selection box left one space\n- `Right arrow`: Move the selection box right one space\n- `Enter`: Commit your guess\n- `R`: Place a red peg in the selected space\n- `O`: Place an orange peg in the selected space\n- `Y`: Place a yellow peg in the selected space\n- `G`: Place a green peg in the selected space\n- `P`: Place a purple peg in the selected space\n- `B`: Place a blue peg in the selected space\n- `Space`: Remove a peg from a space (set it to blank)\n\n## How to run the game on your computer\nThis game works in both Python 2 and Python 3. It relies on the following pypi libraries:\n- Pygame\n- Easygui\n\nAdditionaly, these libraries have external dependencies:\n- SDL (for Pygame)\n- Tkinter (For easygui)\nBoth of these dependencies can be installed on Linux/Mac using the system package manager (homebrew on Mac).\n\nSetup instructions:\n1. Clone or download the repository\n2. Create a virtual environment: `python -m venv env`\n3. Enter the virtual environment\n   - Mac/Linux: `source env/bin/activate`\n   - Windows: `env\\scripts\\activate`\n4. Install Pygame and Tkinter's dependency libraries (see above, may not be necessary on Windows)\n5. Install the pypi requirements: `pip install -r requirements.txt`\n6. Run the game: `python Mastermind.py`\n\nTo uninstall the game, simply delete the virtual environment folder and the script. Then uninstsall the external dependencies.\n\n## Screenshots!\n![The game running on Windows 10](https://user-images.githubusercontent.com/22283943/75075939-ea593d80-54cc-11ea-8cb1-2eff9ca9d1d8.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fravbug%2Fmastermind","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fravbug%2Fmastermind","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fravbug%2Fmastermind/lists"}