Hangman is a common interview coding challenge. The purpose is to design a program to play the elementary game, Hangman, in the terminal. The exercise enables the programmer the opportunity to demonstrate proficiency in their language of choice and grants the interviewer an opportunity to view the coding practices of the programmer.
The root directory contains tests
subdirectory which contains the test files and configuration for program; utilities
subdirectory which contains the required files to run the program (i.e., utilities.py
which contains all of the functions and methods for the program, word-list-sanitizer.py
which is a data processing script that I used to clean a list of words to more accurately match the criteria for my word list, and ``old-word-list.txtand
word-list.txt` which contain 350,000+ and 105,000+ possible words to be used in the game); `documentation.docx` which provides the pre-coding planning, design, and leet-code for the project; `main.py` which contains the main source code; `pyproject.toml` which contains the configuration for the virtual environment, and `README.md`.
Hangman is a fun coding challenge because it can be solved in countless ways. I chose to solve the challenge through an object-oriented programming
approach with a test-driven development
software development lifecycle
. I practiced the use of imported libraries
, input/output
, if statements
, f-strings
, recursion
, list data structures
, list comprehension
, classes
, input sanitization
, functional validation
, lambda functions
, and enumeration
.
Download and unzip the files. Then run main.py
from the root directory.