A clean, modular implementation of the classic Hangman game built with Python 3. This project demonstrates proficiency in Python control flow, data structures (Sets/Lists), and command-line interface (CLI) design.
- Efficient Logic: Utilizes Python
set()operations for O(1) complexity when tracking used letters and validating guesses. - Modular Architecture: Separates game logic (
hangman.py) from data sources (words.py,hangman_visual.py) to ensure code maintainability. - Input Sanitization: Robust handling of user inputs to prevent crashes from invalid characters or repeated guesses.
- Dynamic Visuals: Integrates ASCII art to provide real-time visual feedback on the player's status.
- Data Cleaning: Filters out unsuitable words (containing hyphens or spaces) from the dataset before the game starts.
βββ hangman.py # Main game logic and controller
βββ words.py # Dataset of potential words
βββ hangman_visual.py # Dictionary containing ASCII art states
βββ README.md # Project documentation