Sign in
    C LanguageC Language·Basic

    Hangman Game (Command Line)

    Create a classic Hangman word-guessing game that runs in the command line. The program should select a random word from a predefined list (stored in a file), display the progress (e.g., `_ _ _ _`), and track incorrect guesses.

    What you'll build

    This project involves creating a classic Hangman word-guessing game that runs entirely within the command line interface (CLI). The program will select a random word from an external file containing a list of potential words. It will display the word's length using underscores and progressively reveal letters as the user guesses correctly. The game will track the number of incorrect guesses, often represented by drawing parts of a 'hangman' figure using ASCII characters. The user interacts by typing single letter guesses. The game concludes when the user either guesses the word correctly (win) or runs out of allowed incorrect guesses (loss). Requirements include: a text file named words.txt in the same directory as the executable, containing one word per line (e.g., 'programming', 'hangman', 'computer'). The program should handle basic input validation (checking if the input is a single letter). For portfolio enhancement and potential future expansion, the project includes steps for adding difficulty levels (affecting the number of allowed guesses) and ensuring the code is well-structured and documented.

    What you'll learn

    • File I/O (reading words from a file)
    • String manipulation (comparing characters, revealing letters)
    • Arrays (storing word list, tracking guessed letters)
    • Random number generation
    • Loops and conditional statements
    • Basic game logic implementation

    Roadmap

    11 steps · 90 tasks
    1. ○
    2. ○
    3. ○
    4. ○
    5. ○
    6. ○
    7. ○
    8. ○
    9. ○
    10. ○
    11. ○

    Showcases

    1 approved build
    Arpan Abhishek

    Arpan Abhishek

    about 1 year ago

    CLI Hangman Game written in C.

    Repo
    Sign in to start

    Project facts

    Level
    Basic
    Track
    C Language
    Steps
    11
    Tasks
    90
    Builds
    1 approved
    Sign in to start