{"id":19850096,"url":"https://github.com/ivancaez/mastermind","last_synced_at":"2026-06-09T02:01:41.543Z","repository":{"id":195863579,"uuid":"612182702","full_name":"IvanCaEz/Mastermind","owner":"IvanCaEz","description":"Terminal game done in Kotlin","archived":false,"fork":false,"pushed_at":"2023-03-10T11:29:52.000Z","size":127,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-28T23:11:12.734Z","etag":null,"topics":["game","kotlin","mastermind","terminal-game"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IvanCaEz.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}},"created_at":"2023-03-10T11:29:43.000Z","updated_at":"2023-09-29T12:12:36.000Z","dependencies_parsed_at":"2023-09-19T23:08:50.796Z","dependency_job_id":null,"html_url":"https://github.com/IvanCaEz/Mastermind","commit_stats":null,"previous_names":["ivancaez/mastermind"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/IvanCaEz/Mastermind","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IvanCaEz%2FMastermind","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IvanCaEz%2FMastermind/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IvanCaEz%2FMastermind/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IvanCaEz%2FMastermind/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IvanCaEz","download_url":"https://codeload.github.com/IvanCaEz/Mastermind/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IvanCaEz%2FMastermind/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34088013,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","kotlin","mastermind","terminal-game"],"created_at":"2024-11-12T13:24:18.178Z","updated_at":"2026-06-09T02:01:41.521Z","avatar_url":"https://github.com/IvanCaEz.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Mastermind\n\n## Description\nThis project consist of a game called Mastermind where a sequence\nof 4 out of 5 colors is randomly generated and the user has X tries to guess the right sequence order.\n\nBased on the order of the entered color it will display\na colored circle on that position. Displaying:\n- A gray circle if the color doesn't exist in the sequence.\n- A white circle if the color exists in the word but isn't in the right position.\n- A black circle if the color exists and is in the right position.\n\n---\n\n## Install\n\nUse git to clone this repository into your computer.\n\n\u003e git clone https://gitlab.com/ivan.martinez.7e6/mastermind\n\n---\n\n## Running the project\n\n### Formatting the Output\n\nIn this project we will make use of variables to\ncolor the foreground and background of each character\nwhen needed.\n\n#### Usage\n\n* Write the name or names of the constants you want\n  to use before the next word or character\n* Use the variable `reset` after the desired word or character to end the formatting\n\n---\n\n## How To Play\n\n- The user has 6 tries to guess the right sequence\n- The user have to write 4 colors out of 5 available\n- The colors of the sequence doesn't repeat themselves\n- If the color is in the right position, will print a **black** circle to a history variable.\n- If isn't in the right position will print a **white** one.\n- If doesn't exist, will print a **gray** one.\n\n---\n\n### Code\n\nThe ***instructions*** function will explain the user how to play\nand will ask the user to type ***START*** to begin.\n\n### The Game\n\nThe ***codi*** function is where all the logic of the application lies.\n- First will take a random color from the colorPool and will check if is present on the colorRandomList\n- If the color isn't present, it will be added to the colorRandomList\n- The program will repeat that until the size of the list is 4\n- Then will ask the user for a color, if the color isn't one of the 5 availables or is repeated,\nwill return an error\n\n#### When the user typed 4 colors:\n\n- It will scan every color the user entered and will compare it with the order of the randomized sequence\n- If the color is in the right position, will add a **black** circle to a history variable.\n- If isn't in the right position will add a **white** one.\n- If doesn't exist, will add a **gray** one.\n- Then it will be added to a list called `historyList` and with each iteration will print the content\nof the list creating the history of the game\n- The program will also print the number of the current round.\n- Last it will rest 1 try\n\n##### When is the correct sequence:\n\nWill print a congratulation message and will show the correct sequence.\n\n##### When the user spends all their tries\n\nWill end the programm and the game with a lose.\n\n#### After the game\n\nIf the tries reach 0 or the user guesses the sequence it will ask if the user wants to continue playing,\nread the rules or stop playing.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivancaez%2Fmastermind","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fivancaez%2Fmastermind","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivancaez%2Fmastermind/lists"}