Skip to content

GcherkosH/Hangman-with-Words-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 

Repository files navigation

Hangman Game by using Words API

  1. Requirements: The game requires at least two players. Player one: Makes a secret word Player two : Tries to know the word by guessing one letter at a time *Player one: In this case is the program developed *Player two: A person who plays the game

  2. How it works or how to play? Steps

    1. Program: Presents rules of the game

    2. Program: Requests player to select the difficulty level of the game.

    3. Player: Enters level of the game

    4. Program: Gets a secret random word using Words API by considering the game level chosen by the player ( it uses frequency for choosing a random word )

    5. Program: Presents the length of the secret word by drawing dashes for each letter in the word. (A kind of hint for the player) -> Iterative 6. Program: Requests the player to start guessing letters in the word. 7. Player: Enters letters that he/she think is in the secret word 8. Program: checks if the entered letter is in the word

      A. If the guess is correct, it puts the letter in its right position in the word and presents it to the player

            i.  If the length of correctly guessed letters is equal to the length of the secret word, the players wins.
                     (  It goes to step 9)
            ii. Otherwise, it goes back to step 6.
      

      B. Otherwise, it starts drawing the Hagman

            - There are 8 steps of drawing the hangman.
            
                i. If eight mistakes are made by the player, the Hangman drawing  completes and the player loses the game.  (It goes to step 9)
                
                ii. Otherwise, it goes  back to step 6.
      
    9. Program: Asks the player if he/she wants to play again.
    
            i. If yes, it goes back to step 3.
            ii. Otherwise, it quits
    
  3. Assumptions:

    i. The program allows the player until he/she makes 8 mistakes. ii. Frequency: When a word is retrieved using Words API ,it has a frequency score ranging from approximately 1 to 7. Game levels depend on frequency of words in English.

                 1. Easy:
                 
      		          Frequency >= 7
      		          
                 2.  Middle:
     	               3 <= Frequency <= 4
     	               
                 3. Difficult:
                        Frequency <=2
    
  4. Implementation details:

     Class:  - Hangman
     
     Methods:
            - getSecretword()
                     Gets a secret word by using Words API
            - Defeat()
            - Won()
            - pWordLine()
            - pHangMan()
                 Draws the hangman
             - getLetters()
             - existenceCheck()
                     Checks if the guessed letter is in the word.
             - getChar()
                 Gets guessed letter
             - printInstructions()
             - difficultyLevel()
    
  5. Technologies used:

    • Java
    • IntelLij (Java framework)
    • Maven for handling dependency (Software project management tool )
  6. Issues to be added and fixed:

    Apache client cookies warning - Warning is generated by the Apache client

    Testing: - Unit testing - Integration testing

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages