{"id":20651469,"url":"https://github.com/nikhiljsk/hangman-cli","last_synced_at":"2026-05-27T18:32:45.834Z","repository":{"id":139245697,"uuid":"198278073","full_name":"nikhiljsk/Hangman-CLI","owner":"nikhiljsk","description":"Python CLI which plays hangman, given knowledge of a dictionary. Contains accuracy metrics for word-level and character-level. Does NOT include human interaction.","archived":false,"fork":false,"pushed_at":"2020-03-05T09:38:57.000Z","size":232,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-12-09T02:40:42.944Z","etag":null,"topics":["accuracy-metrics","command-line-interface","hangman-cli","hangman-game","python3"],"latest_commit_sha":null,"homepage":"","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/nikhiljsk.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":"2019-07-22T18:11:14.000Z","updated_at":"2022-02-07T14:48:22.000Z","dependencies_parsed_at":"2023-05-22T17:15:43.268Z","dependency_job_id":null,"html_url":"https://github.com/nikhiljsk/Hangman-CLI","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nikhiljsk/Hangman-CLI","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikhiljsk%2FHangman-CLI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikhiljsk%2FHangman-CLI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikhiljsk%2FHangman-CLI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikhiljsk%2FHangman-CLI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nikhiljsk","download_url":"https://codeload.github.com/nikhiljsk/Hangman-CLI/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikhiljsk%2FHangman-CLI/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33579665,"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-05-27T02:00:06.184Z","response_time":53,"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":["accuracy-metrics","command-line-interface","hangman-cli","hangman-game","python3"],"created_at":"2024-11-16T17:27:36.561Z","updated_at":"2026-05-27T18:32:45.815Z","avatar_url":"https://github.com/nikhiljsk.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hangman\n\n## Project Description\nHangman is a popular game. It involves guessing words rightly in a given number of chances.\nIt starts when an opponent gives you a word (where the actual letter in the words are hidden, i.e, only the lenght of word is given). The player starts guessing with each letter.\n\nThis project is a simulation of the same game, but both the players here are managed by the computer. It does not involve a human.\nGiven a list of words [`words.txt`](https://github.com/nikhiljsk/Hangman-CLI/blob/master/words.txt) in the repository, the computer picks a random word from the dictionary and assigns it to the other program [`hangman_driver.py`](https://github.com/nikhiljsk/Hangman-CLI/blob/master/hangman_driver.py)\n\nThe [`hangman_driver.py`](https://github.com/nikhiljsk/Hangman-CLI/blob/master/hangman_driver.py) has the knowledge of the dictionary and it starts guessing the words by analysing the most occurred letter in the dictionary for the given lenght of word. It guesses the word and evaluates the result. Once it gets the letter right, it refines its search for that particular words where the rightly guessed pattern is present.\n\n## Code - Components\nThere are two major files related to python code \u003cbr\u003e\n\n* [`hangman_driver.py`](https://github.com/nikhiljsk/Hangman-CLI/blob/master/hangman_driver.py) -- The driver code, which drives the entire gameplay. Starts by picking out a random word from the dictionary ([`words.txt`](https://github.com/nikhiljsk/Hangman-CLI/blob/master/words.txt)) and goes on to guess the letter, evaluates the result, refines the search-words and the process continues till the right word is guessed.\u003cbr\u003e\nIt uses some [`helper_modules/`](https://github.com/nikhiljsk/Hangman-CLI/tree/master/helper_modules) for picking, guessing, evaluate and search-refined-words. \u003cbr\u003e\n* [`accuracy_scorer.py`](https://github.com/nikhiljsk/Hangman-CLI/blob/master/accuracy_scorer.py) -- A code file which uses [`hangman_driver.py`](https://github.com/nikhiljsk/Hangman-CLI/blob/master/hangman_driver.py) and runs on all the words in the dictionary [`words.txt`](https://github.com/nikhiljsk/Hangman-CLI/blob/master/words.txt). Metrics are displayed below this section \u003cbr\u003e\n\n## How to run\n1. pip install -r requirements.txt\n2. python hangman_driver.py\n3. python accuracy_scorer.py\n\n## Metrics\n```\nPrediction Accuracy (Word-wise)\nINFO: This expalins the number of words predicted rightly\n\nTotal words to guess         : 4507\nTotal words predicted rightly: 4504\nWord-wise Accuracy         : 99.93 %\n\n\nPrediction Accuracy (character-wise)\nINFO: This expalins the number of chances taken to predicted the entire word_set (words.txt) rightly\n\nTotal characters to guess    : 41016\nTotal guesses taken          : 45280\n\nCharacter-wise Accuracy    : 90.58 %\n```\n\nAlso, the code is well-documented. \u003cbr\u003e\nCheers :)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikhiljsk%2Fhangman-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnikhiljsk%2Fhangman-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikhiljsk%2Fhangman-cli/lists"}