{"id":22786304,"url":"https://github.com/kdlamini/mastermind-ruby","last_synced_at":"2026-05-02T13:31:52.168Z","repository":{"id":128390861,"uuid":"299074892","full_name":"KDlamini/Mastermind-Ruby","owner":"KDlamini","description":"A Ruby code-breaking CLI game for two players. It resembles an earlier pencil and paper game called Bulls and Cows that may date back a century or more. Built with Ruby.","archived":false,"fork":false,"pushed_at":"2022-01-24T08:10:54.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-30T15:47:25.435Z","etag":null,"topics":["game","game-development","ruby"],"latest_commit_sha":null,"homepage":"https://replit.com/@SimoNkosi/Mastermind-Ruby#mastermind.rb","language":"Ruby","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/KDlamini.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-09-27T16:41:24.000Z","updated_at":"2022-01-24T08:10:57.000Z","dependencies_parsed_at":"2023-04-14T06:17:55.050Z","dependency_job_id":null,"html_url":"https://github.com/KDlamini/Mastermind-Ruby","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/KDlamini/Mastermind-Ruby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KDlamini%2FMastermind-Ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KDlamini%2FMastermind-Ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KDlamini%2FMastermind-Ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KDlamini%2FMastermind-Ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KDlamini","download_url":"https://codeload.github.com/KDlamini/Mastermind-Ruby/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KDlamini%2FMastermind-Ruby/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32536559,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T12:25:33.646Z","status":"ssl_error","status_checked_at":"2026-05-02T12:24:51.733Z","response_time":132,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["game","game-development","ruby"],"created_at":"2024-12-11T23:23:28.661Z","updated_at":"2026-05-02T13:31:52.129Z","avatar_url":"https://github.com/KDlamini.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MASTERMIND\n\n**Mastermind** or **Master Mind** is a code-breaking game for two players. The modern game with pegs was invented in 1970 by *Mordecai Meirowitz*, an Israeli postmaster and telecommunications expert. It resembles an earlier pencil and paper game called *Bulls and Cows* that may date back a century or more.\n\n## Gameplay and rules\n*  *A decoding board*, with a shield at one end covering a row of four large holes, and twelve (or ten, or eight, or six) additional rows containing four large holes next to a set of four small holes;\n*  *code pegs* of four different colors, with round heads, which will be placed in the large holes on the board; and\n*  *key pegs*, some colored black, some white, which are flat-headed and smaller than the code pegs; they will be placed in the small holes on the board.\n\nThe two players decide in advance how many games they will play, which must be an even number. One player becomes the codemaker, the other the codebreaker. The codemaker chooses a pattern of four code pegs. Duplicates and blanks are allowed depending on player choice, so the player could even choose four code pegs of the same color or four blanks. In the instance that blanks are not elected to be a part of the game, the codebreaker may not use blanks in order to establish the final code. The chosen pattern is placed in the four holes covered by the shield, visible to the codemaker but not to the codebreaker.\n\u003cbr /\u003e\n\u003cbr /\u003e\n## `Playing the game`\nIn the root directory, on your preferred command line interface run:\n```\nruby mastermind.rb\n```\n\u003cbr /\u003e\n\n### Instructions\nWhen playing the game you will see flags next to the board as you guess the combination:\n\n`Red Flag`: Means you guessed the right colour in the right position.\n\n`White Flag`: Means you guessed the right colour in the wrong position.\n\nThese are your hints. The end goal is to guess all four correct colours in the exact order.\n\nFor example:\n\nIf the secret code is **'bgyw'** and you guessed **'wygb'**. You will get four white flags, meaning you guessed all four colours right but they are all in the wrong order. You must figure out the correct order, and your final guess must be exactly **'bgyw'**.\n\u003cbr /\u003e\n\u003cbr /\u003e\n## Acknoledgements\n\nThis project is part of [The Odin Project curriculum](https://www.theodinproject.com/courses/ruby-programming/lessons/oop?ref=lnav). Awesome on-line web development learning place!\n\n* [Reference](https://en.wikipedia.org/wiki/Mastermind_(board_game))","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkdlamini%2Fmastermind-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkdlamini%2Fmastermind-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkdlamini%2Fmastermind-ruby/lists"}