Coder Social home page Coder Social logo

hangman-cli's Introduction

Hangman Logo

Hangman-CLI

The classic word game, implemented in Python.

The current version selects words from a chosen subject.

Rules of the game

Objective:

Your goal is to guess the mystery word chosen by the computer opponent.

How to play:

  1. Enter your name when prompted.
  2. Select a category when prompted.
  3. The computer will think of a secret word and tell you how many letters are in the word.
  4. Make guesses one letter at a time to guess the secret word.
  5. If you think that you know the word, you may guess the entire word.
  6. Each time you guess a letter, all occurrences of that letter in the word will be shown.
  7. If your guess is incorrect, a part of the hangman figure will be drawn.
  8. Continue guessing letters to reveal the entire word.
  9. You may quit at any time by pressing "Ctrl + C".

Winning and Losing:

  • If you correctly guess the word before the full hangman figure is drawn, you win.
  • If the full hangman figure is drawn before you guess the word, you lose.

Installation Requirements

Hangman-CLI requires Python version 3.9 or later. This is usually available by default in Linux. For other operating systems, Python may be downloaded from: Python.org.

Where to Download Hangman-CLI

Latest release (all files): Hangman-CLI Releases.

Each release includes:

  • hangman.py: The Python application.
  • ascii_art.py: The game's ascii artwork.
  • lexicon.py: The game's wordlists.
  • hangman_installer.run: An installer for Linux only.
  • Source code (zip): The source code (ZIP archive).
  • Source code (tar.gz): The source code (tarball),

Using the Linux installer

The installer app has been tested on Ubuntu and Debian.If you have any difficulty with it on your system, please post an issue HERE

  1. Download the file: hangman_installer.run

  2. Set the file permissions to executable.

    • GUI method:

      • Right click on file > Properties
      • in the 'Permissions' tab, enable "Allow this file to run as a program."
    • Command line method:

      chmod +x hangman_installer.run

  3. Double-click on the installer to install the game.

The installer will extract the following files:

  • hangman-cli -> ~/.local/bin/Hangman-CLI/hangman-cli
  • ascii_art.py -> ~/.local/bin/Hangman-CLI/ascii_art.py
  • lexicon.py -> ~/.local/bin/Hangman-CLI/lexicon.py
  • hangman-cli.ico -> ~/.local/share/icons/hangman-cli.ico
  • hangman-cli.desktop -> ~/.local/share/applications/hangman-cli.desktop

The hangman-cli.desktop file should be detected automatically by the Desktop menu and create a launcher in the Games section.

After installation, the game may be launched, either from your Applications menu or by entering the command hangman-cli in a Terminal window.

Uninstalling To uninstall hangman, run the installer in a terminal window:

bash hangman_installer.run -- --clean

All Platforms

If you don't have Linux, or prefer to play the game without installing, Hangman-CLI is also available as a ZIP package.

Windows

Preferred Method:

  1. Download the file: hangman.py
  2. Extract the contents of the ZIP file somewhere convenient.
  3. Double-click on the hangman.py file.

Alternate Method:

  1. Download the file: hangman.py
  2. Extract the contents of the ZIP file somewhere convenient.
  3. Open Command Prompt by typing "cmd" in the Start menu.
  4. Use cd path\to\hangman.py to navigate to the folder containing hangman.py
  5. Launch the game with the command: py hangman.py

macOS

  1. Download the file: hangman.py
  2. Extract the contents of the ZIP file somewhere convenient.
  3. Drag the hangman.py file to PythonLauncher.

Linux

  1. Download the file: hangman.py
  2. Extract the contents of the ZIP file somewhere convenient.
  3. Open a Terminal window from the Applicatins menu, or "Ctrl + Alt + T".
  4. Use cd path/to/hangman.py to navigate to the folder containing hangman.py
  5. Launch the game with the command: python3 hangman.py

License

This program is released under the MIT license.

Issues

Please report any issues HERE.

Acknowledgments

The installer for this game was created using makeself.

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.