GithubHelp home page GithubHelp logo

laibashakil / word-guessing-game Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 11 KB

This is a simple command-line game where the player has to guess a randomly selected word within 10 attempts. The game provides a hint about the word, and the player can guess a letter at a time.

License: MIT License

Python 100.00%

word-guessing-game's Introduction

Word Guessing Game

This is a simple command-line game where the player has to guess a randomly selected word within 10 attempts. The game provides a hint about the word, and the player can guess a letter at a time. If the guessed letter is present in the word, the game reveals its position(s) in the word; otherwise, the game keeps track of the wrong guesses. The game ends if the player guesses the entire word correctly within 10 attempts or runs out of attempts.

How to Play

  1. Introduction: Upon starting the game, you'll be greeted with an introduction and a hint about the word to be guessed.
  2. Guessing: You have 10 attempts to guess the word correctly. Input a letter to make your guess.
  3. Feedback: If your guessed letter is correct, it will reveal its positions in the word. If it's wrong, it'll be added to the wrong guesses list.
  4. Win or Lose: The game continues until you correctly guess the word or run out of attempts.

Example

You have 10 attempts to guess the word correctly.
Hint: It is red in color!
The word is of 6 letters.
_ _ _ _ _ _
Guess a letter: a
_ _ _ a _ _
You have 9 attempts left.
Guess a letter: e
You guessed a wrong letter
_ _ _ a _ _
You have 8 attempts left. 
Guess a letter: i
You guessed a wrong letter
_ _ _ a _ _
You have 7 attempts left. 
Guess a letter: o
_ o _ a _ o
You have 6 attempts left.
Guess a letter: t
t o _ a t o
You have 5 attempts left.
Guess a letter: m
t o m a t o
You win! Your word was tomato

Requirements

  • Python 3.x

Getting Started

  1. Ensure Python is installed on your system.
  2. Clone or download this repository to your local machine.
  3. Run the word_guessing_game.py file using a Python interpreter.

Contributing

We welcome contributions to enhance the game! Feel free to add new features, improve the user interface, or optimize the code. If you encounter issues or have suggestions, please open an issue in the repository.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Let the guessing begin! ๐ŸŽ‰

word-guessing-game's People

Contributors

laibashakil avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.