Skip to content

🎮 A Python-based word guessing game where players reveal hidden phrases by guessing letters. Practice Python skills with this interactive and fun game.

License

Notifications You must be signed in to change notification settings

orguetta/GuessTheWord

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Word Guessing Game

Introduction

Hello there! Welcome to the Word Guessing Game Readme. This Python script is a simple and interactive word guessing game that challenges players to reveal hidden phrases by guessing letters. As a fellow Python learner, you can explore and understand the code to enhance your programming skills.

How to Play

  1. Getting Started:

    • Ensure you have Python installed on your system.
    • Copy the provided Python script into a file, for example, word_guessing_game.py.
  2. Run the Game:

    • Open a terminal or command prompt.
    • Navigate to the directory containing the script.
    • Run the script using the command:
      python word_guessing_game.py
  3. Game Rules:

    • You'll be presented with a hidden phrase represented by underscores.
    • Guess letters one by one to reveal the hidden phrase.
    • For each correct guess, you earn points; for each incorrect guess, you lose points.
    • The game ends when you successfully reveal the entire phrase.
  4. Scoring:

    • Correct Guess: +5 points
    • Incorrect Guess: -1 point
    • Bonus for Finishing within 30 Seconds: +100 points
  5. Example Phrases:

    • The game uses a predefined list of phrases, conveying positive and motivational messages.
  6. Game Flow:

    • The script utilizes functions to create and update the underscored phrase, as well as the main game loop.
    • Time is measured to encourage players to complete the game quickly.

Code Breakdown

  1. Modules:

    • random: For selecting a random phrase.
    • time: For measuring the time taken.
  2. Functions:

    • create_underscore_phrase(phrase): Generates the initial underscored phrase.
    • update_underscore_phrase(phrase, underscore_phrase, guess): Updates the underscored phrase based on guessed letters.
    • play_game(phrases): The main game function.
  3. List of Phrases:

    • Phrases are predefined in a list of lists.
  4. Example Usage:

    • The game is started by calling the play_game function with the list of phrases.

Learning Opportunities

  1. Function Usage:

    • Observe how functions are used to modularize the code and enhance readability.
  2. List Manipulation:

    • Explore how lists are used to represent phrases and underscores.
  3. Conditional Statements:

    • Understand how conditional statements drive the game logic.
  4. Random Module:

    • Learn about the random module and how it's used for phrase selection.
  5. Time Module:

    • Explore the time module for measuring the duration of the game.

Have Fun Learning!

Feel free to experiment with the code, make modifications, and enhance the game. This script serves as a practical example for applying Python concepts in a fun and interactive way. Happy coding!

About

🎮 A Python-based word guessing game where players reveal hidden phrases by guessing letters. Practice Python skills with this interactive and fun game.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages