Giter VIP home page Giter VIP logo

hangman_game's Introduction

Hangman Game

Hangman Game is a Python terminal game which runs in the Code Institute mock terminal on Heroku.

To win the Hangman Game. The user has to guess the correct letters to complete the word. If the user don't complete the word within 7 guesses, then the hangmang guy dies and the game is over.

Here is a live version of my project.

hangman-amiresponsive

How To Play

Before the game starts. The player is given a choice between starting the game or exit the game by typing "yes" or "no". If the player types in "yes" the game starts. If the player types in "no" the game ends.

If the player choose to start the game. The player then gets assigned a hidden word from the computer. The user gets information that he or she has 7 lives left to complete the word.

To win the game you have to guess all the correct letters to complete the word. The player lose one life for each wrong guess that has been made. The game ends if the player lose all the 7 lives before completing the word.

hangman-start

Features

Existing Features

  • A random word from a list of 440 words are being generated into the game.
  • The player gets a hint of how long the word is by counting the lines were the correct letters later will be placed.
  • Each correct letter is being placed in the correct order of the word.

hangman-first-letter

  • Accept user input.
  • Maintains how many lives the player has left.
  • Maintains which letters the player have guessed.
  • Responds "Wrong!" if the player guesses the wrong letter.
  • A hanging man viusalize how many guesses left before the game ends.

hangman-second-part

  • Input validation and error-checking.
    • You can only enter letters. Not other characters.
    • You cannot enter the same guess twice.

hangman-input-validation

Future Features

  • Allow players to also guess the word directly instead of each letter.
  • Add a scoreboard of the best players.

Testing

I have manually tested this project by doing the following:

  • Passed the code through pep8online without any bugs.
  • Given invalid inputs when playing the game. For examples numbers and other characters.
  • Tested in my local terminal and the Code Institute Heroku Terminal.

pep8-test

Bugs

Solved Bugs

  • When I tested the game I found out that it did not have a return value at the end of the game. So everytime the game ended "None" got printed on the screen.
  • I fixed this bug by calling the start_game() function again.

hangman-fixed-bug

Remaining Bugs

  • No bugs remaining.

Validator Testing

  • No errors were returned when testing all three files.

pep8-test pep8-test2 pep8-test3

Deployment

This project was deployed using Code Institute's mock terminal for Heroku.

  • Steps for deployment:
    • Clone this repository.
    • Create an account and a new app on Heroku.
    • Configure vars with "KEY" in port and "8000" as value.
    • Set the buildpacks to python and nodeJS in that order.
    • Connect Heroku to Github.
    • Connect and deploy the repository.

Credits

hangman_game's People

Contributors

ehnvik avatar

Watchers

James Cloos 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.