Code Monkey home page Code Monkey logo

hangman's Introduction

hangman

A simple game with easy rules, written purely in python.

GUI and CLI versions available.

About the Game

HangMan is an interactive real world game. The game chooses an entirely random word,and the user tries to guess it by suggesting letters untill the hangman figure is completed.

GUI CLI
dg dd

RULES

  1. Number of Dashes represent the length of the word.
  2. At each correct guess the letter is placed at its original position in the word.
  3. User loses if the HangMan is completed.

Modules used-

  • pygame
  • rich
  • nltk

Use pip install -r requirements.txt to install the modules automatically.

Running the game

Currently the program is not packaged into exe or any other format, so you have to run the python file directly.
New contributers can implement packaging the game into an executable.

Recent Releases contain executable file for Linux.

For Linux

  • Run the executable.

    • You can download the latest executable file from releases
    • Make the file executable
      sudo chmod +x filename
      
    • Run the file ./filename

  • Run with python interpreter.

    • Install requisite modules(see modules section).
    • Navigate to either GUI/CLI folder and run python3 hangman.py

For Window

Dude use Linux ๐Ÿ˜‰

  • There is no exe file for windows users. ๐Ÿค: (PRs Welcome)
  • Just replace python3 with python in the above steps.

Hacktoberfest2022

image

It is back again the time of the year to celebrate Hacktoberfest. This repository contains coding exercises that you can easily solve with basic knowledge in programming.

What is Hacktoberfest?

Every year in October, an open source event called Hacktoberfest inspires individuals all over the world to actively engage in and contribute to open source projects that are hosted on GitHub and GitLab. By taking part in this event, you may receive a free GitHub swag pack. You must submit 4 pull requests in order to receive that awesome swag pack.

Follow these step -:

  1. Complete the registartion over https://hacktoberfest.com/
  2. Rule are - https://hacktoberfest.com/participation/
  3. Fork this repository.
  4. The copy of main repository is on your PC/Desktop .

You can send your pull request to this repository.

Enjoy Hacking. All the best.

Want to contribute?

We welcome any contribution big/small, but do note that we are against plagiarism and low code quality.

For instance, avoid submitting a PR fixing a issue with spacing or a minor change, this hampers the spirit of hacktoberfest.

Take a look through some of our issues you can resolve, or create your own issue https://github.com/anantdark/hangman/issues

Our Top Contributors

hangman's People

Contributors

akinolaemmanuel49 avatar ambushneupane avatar anantdark avatar droid31 avatar haidao0923 avatar kirkland-signature avatar leinadsened avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

hangman's Issues

Merge gui and cli

Currently if the user has to run the game in GUI/CLI mode, he has to run the respective python file in the folder.
Create a "master" python program which after running gives the option to select from GUI/CLI Interface.
The respective python code(GUI/CLI) shall be executed as per the selected option.

  • Try not to shift the existing file structure.
  • Try not to rename the existing files.

Hangman android app

We have hangman GUI and CLI for Windows and Linux.
We can also have an android app hangman-app.
Any more platforms left. ๐Ÿ˜œ

Should have player accounts

Discussed in #19

Originally posted by anantdark October 11, 2022
We can implement various player accounts
The player accounts will be logging in with their password.
Accounts will have saved history of scores.

Package the game

Create an executable (exe, deb, appimage, whl) file to play the game.

Unify wordlist

Currently hangman-cli and hangman-gui handle their wordlist separately with different word lists and word generator modules.
We can unify that into a single module using a single wordlist.

Show the word's meaning

After the game has ended, either in lose or win. The user should get the meaning of the word alongside the word.
We can implement it in two ways.

  • Change the wordlist to store words and their meanings and show them accordingly.
  • Change the code and let the user add the meaning of the word after the game, eventually the wordlist will be full with word meanings.

Hangman-GUI needs a logo

The GUI application shows the default logo of pygame on the taskbar, need to replace that with a custom logo, also need the logo on the application window.

Refactor Readme.md

Rewrite readme.md as a stylised welcome page.
Can take notes from any of the top forked/starred repos.

Improve CLI

The CLI needs to be improved.
Some suggestions include

  • welcome page
  • clear screen after every guess
  • many more...

Store used letters in hangman-cli

Hangman-GUI removes the letters guessed from the screen, but you can input the same letter multiple times in hangman-cli.
The user should get a prompt reminding he has already used this letter and should choose a different one.

Improve wordlist

Improve the existing wordlist with better/more-known words, as some of the words in the existing wordlist can't be used in the game because they are too hard to guess.

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.