{"id":20895986,"url":"https://github.com/dan-q/hangman-cheat","last_synced_at":"2025-07-09T12:47:28.499Z","repository":{"id":139818539,"uuid":"210888895","full_name":"Dan-Q/hangman-cheat","owner":"Dan-Q","description":"Hangman game that cheats without contradicting its previous statements.","archived":false,"fork":false,"pushed_at":"2024-09-24T10:49:42.000Z","size":477,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-06T02:54:14.769Z","etag":null,"topics":["cheat","cheating","hangman","hangman-game","javascript","javascript-game","words"],"latest_commit_sha":null,"homepage":"https://cheatman.danq.me/","language":"JavaScript","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/Dan-Q.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-25T16:16:36.000Z","updated_at":"2025-02-10T23:57:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"f79c1ea0-a02b-47ad-b420-1fa036e712f3","html_url":"https://github.com/Dan-Q/hangman-cheat","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/Dan-Q%2Fhangman-cheat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dan-Q%2Fhangman-cheat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dan-Q%2Fhangman-cheat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dan-Q%2Fhangman-cheat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Dan-Q","download_url":"https://codeload.github.com/Dan-Q/hangman-cheat/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243280237,"owners_count":20265982,"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":["cheat","cheating","hangman","hangman-game","javascript","javascript-game","words"],"created_at":"2024-11-18T10:31:47.122Z","updated_at":"2025-10-14T12:05:37.760Z","avatar_url":"https://github.com/Dan-Q.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cheatman\n\nA game of hangman that cheats while keeping its lies internally-consistent.\n\n## How To Play\n\nPlay at [cheatman.danq.me](https://cheatman.danq.me/). Guess letters to see if you can\nfind the word\n\nThe default configuration, which you can change on the fly using checkboxes, is:\n\n* *Cheat mode on*: turn it off to disallow the computer from cheating i.e. make it\n  into a normal game of Hangman. Doing this selectively i.e. mid-game can provide \n  insights into how it works.\n* *Transparent cheating on*: when the computer cheats, it'll tell you so. Turn this\n  off to make the game _feel_ like it's fair (but difficult).\n* *Ghost mode off*: Turning on ghost mode will allow you to see, faintly in the\n  boxes, the word that the computer is thinking of. It'll change it's mind as you\n  guess (if cheat mode is on), of course: turning this on is a great way to see how\n  it works.\n\nYou can download the [full source](https://github.com/dan-q/hangman-cheat) and run it\non any web server (it can't be run from file:// URLs because it uses the Fetch API to\ndownload the wordlist).\n\n## History\n\nIn 2012, the inimitable [Nick Berry](http://datagenetics.com/) derived the\n[optimal strategy for playing Hangman](http://datagenetics.com/blog/april12012/index.html); \nthat is, for the English language, the optimal letters you should choose for any given\nword length; his approach can easily be extended to suggest the optimal letters for any\ngiven game state (e.g. \"having a word of this length and having guessed these letters\nand found them to be in those positions, what should I guess next\").\n\nIn 2013, I adapted this approach to determine\n[the hardest words to guess at Hangman](https://danq.me/2013/12/15/hangman/). In other\nwords: if you know that your opponent will be playing optimally, which words should\nyou choose from in order to maximise the number of guesses the player has to make\nbefore they get it. Naturally, this doesn't work as well against a \"smart\" player who\nknows that you're trying to catch them out, but it could probably be expanded into\na strategy that selectively chooses \"hard\" words at rate appropriate to the expected\nsuspicion level of the player guessing.\n\n## How It Works\n\nThis new project, though, goes in another direction: this hangman _cheats_! Every time\na letter is guessed, the game considers all of the words that it could _possibly_ have\nchosen that are consistent with the statements it's made so far about the length of\nthe word, the number and position of correctly-guessed letters, and the identity of\nincorrectly-guessed letters. And then, if applicable, it changes the word it was\nthinking of in order to maximise the expected search space, i.e. to make it as hard\nas possible for you to guess the word.\n\nRead my blog post about it at https://danq.me/2019/09/26/cheatman/.\n\n## Development/Future\n\nYou'll find a stack of constants at the top of `cheat.js` which configure how the\ngame behaves, e.g. you can tweak the threshold (number of possible remaining words)\nat which it starts to cheat in order to balance the strength of cheating against the\nperformance of the game (it's not fast!).\n\nI'm considering adding \"friendly\" features like a PWA manifest (making it \"installable\"),\nprettier UI, varied output messages, sound effects (possibly even voice?), etc. But I'm\nin no hurry, and I'm happy to consider pull requests from anybody who's got more\ntime/energy than I.\n\n## Author\n\n* [Dan Q](https://danq.me/)\n\n## License\n\nThis program is free software: you can redistribute it and/or modify it under the terms\nof the Affero GNU General Public License.\n\nThis project includes a dictionary (`wordlist.txt`) which is in the public domain.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdan-q%2Fhangman-cheat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdan-q%2Fhangman-cheat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdan-q%2Fhangman-cheat/lists"}