{"id":18744023,"url":"https://github.com/at1as/hangman","last_synced_at":"2025-10-04T07:10:29.707Z","repository":{"id":78922962,"uuid":"106125306","full_name":"at1as/Hangman","owner":"at1as","description":"Simple hangman solver written in Crystal","archived":false,"fork":false,"pushed_at":"2017-10-07T20:11:17.000Z","size":4,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-20T06:37:23.058Z","etag":null,"topics":["algorithm","crystal","dictionary","game","hangman","terminal"],"latest_commit_sha":null,"homepage":null,"language":"Crystal","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/at1as.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":"2017-10-07T19:37:33.000Z","updated_at":"2018-09-10T08:48:42.000Z","dependencies_parsed_at":"2024-03-13T09:51:36.857Z","dependency_job_id":null,"html_url":"https://github.com/at1as/Hangman","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/at1as/Hangman","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/at1as%2FHangman","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/at1as%2FHangman/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/at1as%2FHangman/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/at1as%2FHangman/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/at1as","download_url":"https://codeload.github.com/at1as/Hangman/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/at1as%2FHangman/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262578829,"owners_count":23331700,"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":["algorithm","crystal","dictionary","game","hangman","terminal"],"created_at":"2024-11-07T16:13:27.918Z","updated_at":"2025-10-04T07:10:24.658Z","avatar_url":"https://github.com/at1as.png","language":"Crystal","readme":"# Hangman\n\nSimple script to solve hangman.\n\nDoes the following:\n* Selects a word a random from the dictionary\n* Given the length of the word, finds the most common letter occurances across all words of that length\n* Simple algorithm\n  * Guesses most common letters until solution is found\n* Improved algorithm\n  * Filters for most common letters at every iteration for dictionary words that match pattern of the guessed letters\n  * Continues until solution is found\n\nNote: Syntax is nearly Ruby compatable, however tuple types need to be changed to Hash and type decleration needs to be removed from the array.\n\n\n## Usage\n\n```\n$ crystal hangman.cr\n```\n\n## Output\n\n### Simple Algorithm\n```\n$ crystal hangman.cr  --error-trace\n\nSelecting a word from the dictionary at random...\n\nThe word is --------- (9 of 9 digits remaining)\nSolving using simple algorithm...\n\nTrying with e...\nThe word is ------e-- (8 of 9 digits remaining)\n\nTrying with i...\nThe word is ------e-- (8 of 9 digits remaining)\n\nTrying with a...\nThe word is --a---e-- (7 of 9 digits remaining)\n\n...\n\nTrying with y...\nThe word is crac-less (1 of 9 digits remaining)\n\nTrying with g...\nThe word is crac-less (1 of 9 digits remaining)\n\nTrying with b...\nThe word is crac-less (1 of 9 digits remaining)\n\nTrying with f...\nThe word is crac-less (1 of 9 digits remaining)\n\nTrying with v...\nThe word is crac-less (1 of 9 digits remaining)\n\nTrying with k...\nThe word is crackless (0 of 9 digits remaining)\n\nSolved after 22 iterations with simple algorithm\n```\n\n### Improved Algorithm\n```\nSolving using improved algorithm...\n\nTrying with e...\nThe word is ------e-- (8 of 9 digits remaining)\n\nTrying with s...\nThe word is ------ess (6 of 9 digits remaining)\n\nTrying with n...\nThe word is ------ess (6 of 9 digits remaining)\n\nTrying with l...\nThe word is -----less (5 of 9 digits remaining)\n\nTrying with r...\nThe word is -r---less (4 of 9 digits remaining)\n\nTrying with t...\nThe word is -r---less (4 of 9 digits remaining)\n\nTrying with a...\nThe word is -ra--less (3 of 9 digits remaining)\n\nTrying with c...\nThe word is crac-less (1 of 9 digits remaining)\n\nTrying with k...\nThe word is crackless (0 of 9 digits remaining)\n\nSolved after 10 iterations with improved algorithm\n\n```\n## Notes\n\n* Build on `Crystal 0.23.1 (2017-09-08) LLVM 4.0.1`\n* Requires list of words to be under `/usr/local/share/dict` as is default on macOS\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fat1as%2Fhangman","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fat1as%2Fhangman","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fat1as%2Fhangman/lists"}