Giter Club home page Giter Club logo

the-hangman-2's Introduction

THE HANGMAN

Hangman is classic word guessing game played between two or more players. In this particular case game is played against the computer. Computer sets a word and the player has to guess correctly, given a certain number of trials. For every wrongly guessed word, a life in the game is lost and a “hanging-man” begins to appear, piece by piece. The aim is to solve the puzzle and guess the correct word before the hangman dies. It's a Python terminal game, which runs in The Code Institute mock terminal on Heroku.

Live link for the site can be found here: https://the-hangman-1705.herokuapp.com/

Responsivness

Contents Table

  1. How to play

  2. Features

  3. Testing

  4. Deployment

  5. Credits

How to play

  • Computer chooses random word
  • A player takes an initial guess at a letter that might be contained in the word
  • If the letter is contained in the word the player gains a point and takes another turn guessing a letter.
  • If the letter is not contained in the word, the player losses a life, and a part of the hangman appears.
  • For every wrong guess the hangman appears bit by bit until the complete image is drawn.
  • Similarly, for every correctly guessed letter, the letters are placed on the screen until the word is completed and the player wins.
  • Player has 6 lives

Features

Existing Features

  • Welcomes the player
  • Collects player's name, capitalize it
  • Explains the goal of the game
  • Shows initial picture of The Hangman game (empty gallows)
  • Accepts user input
  • Play against the computer
  • Generates random word

Welcome

  • Input validation, error-check
    • Player must enter letter from english alphabet
    • Player can't enter the same guess multiple times
    • Player is allowed to enter only single letter
    • Player is getting notified about wrong letters

Input validation

  • Game checks if player won or lost the game and prints appropriate message accordingly
  • Notifies the player what the secret word was
  • Asks the player if he would like to play the game again, if yes(Y,y) the game resets, if no(any other key), prints appropriate message and says good bye to the player

Game lost

Game won

Play again

Testing

I have manually tested the project doing the following:

  • Passed the code through PEP8 linter and confirmed there are no problems, only irrelavant minor issues which don't affect the code
  • Given invalid inputs: same input twice, single letter input, inputs from english alphabet
  • Tested in my local Gitpod terminal & the Code Institute Heroku terminal

Bugs

Solved Bugs

  • Game was starting with picture No.2 instead No.1 (empty gallows) in the list.
    • Simple fix by deleting empty space between quotation marks in wrong_letter & correct_letters variables
  • After completing the game I had to press extra random letter to finish the game instead automatic completion of the game after the win
    • I had to change while loop in program_run function from True to False by adding variable game_over and declare it to False

Unsolved Bugs

  • No remaining unsolved bugs

Validator Testing

Deployment

Project was deployed using Code Institute's mock terminal for Heroku

  • Steps:
    • Create a new Heroku app
    • Set the buildbacks to Python & NodeJS in that order
    • Link Heroku app to the repository using Gitpod terminal
      • heroku login -i
      • enter personal email
      • enter pasword using API Key from Heroku
      • heroku git:remote -a "name of the app from Heroku"
      • git push heroku main

Credits

  • Code Institute for the deployment terminal
  • Scott & Gemma from tutor support who helped me and pointed me to right direction to solve some issues with my code

Code

the-hangman-2's People

Contributors

koby1705 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.