Python Hangman game

I wrote this a few years ago while I was going through the projects on inventwithpython.com and this one interested me beyond just following along. You start in chapter 8 (http://inventwithpython.com/invent4thed/chapter8.html) making a hangman game with ASCII art and a list of words. Chapter 9 (http://inventwithpython.com/invent4thed/chapter9.html) expands it with multiple difficulty settings and word options.

The code for those 2 parts are linked but I wanted to take it further. I started thinking that there must be a bunch of text files out there with all English words. I figured there would be a dictionary or Webster’s.txt but I haven’t found one. I found many files with 10’s to 100’s of thousands of words, so I grabbed one and started playing.

https://github.com/dwyl/english-words
https://sites.google.com/a/vhhscougars.org/johnsearch/searchindex/oxford-english-dictionary
http://www.gwicks.net/dictionaries.htm

All that had to change was to make the words variable open the file words = list(open(‘words_alpha.txt’)) instead of putting the list directly in the code as a list, or dictionary, depending on which chapter you’re working on. It’s a small change code-wise but it opens up the game to new possibilities.

I’m having problems finding lists of specific words but I’d like to build on chapter 9 and have topics, and maybe hints. The hints could be in the file or be scrapped from search engine results.

If I continue to work on it here’s the Gitlab https://gitlab.com/andrewjwhittle/hangman