/ruby_hangman

Hangman game to be played in a command-line interface. By Jim Farrugia and Natasha Khatri

Primary LanguageRuby

Changelog:

  • Display ascii art depictions of lives-left after clearing terminal when displaying validation messages and the like, unless zero lives-lost.
  • Create a method for building path and displaying ascii images. (DRY)
  • ASCII-art image on victory.
  • ASCII-art image on game over.
  • ASCII-art to display lives left.
  • Added ASCII-art title to welcome screen with tty-font gem.
  • Screen/terminal clears throughout the game to display only relevant data.

To Do:

  • Points tally for multiple games.
  • Allow for words with spaces
  • Allow for words with special characters / punctuation. (punctuation should be filled-in for the user)
  • Play sounds after user input based on result of that input.

Hangman

By Jim Farrugia and Natasha Khatri

GitHub Repository

https://github.com/Jimfarrugia/ruby_hangman

Description

Hangman is an educational word guessing game to be played in a command-line interface. The game has been created with Ruby.

Purpose

The purpose of Hangman is to provide a fun way of learning vocabulary and testing your general knowledge. This is done by allowing the user to guess the secret word one letter at a time, which can also be helpful for remembering the spelling of new words.

Functionality

  • Start program
  • Program greets the user.
  • Program prompts user for input if they want to play
    • If user enters "No", program exits
    • If user enters "Yes, program continues
  • Prompts user for username, if nothing entered defaults to "Player"
  • Program randomly generates a word for user to guess
  • Prompts the user for input of a letter
  • Checks user input
    • If correct, displays letter in secret word
    • If incorrect, displays number of lives left
  • User input will loop until:
    • All letters are matched in the secret word
      • If true, then will display the secret word and victory screen
    • There are 0 lives left
      • If true, then will display the secret word and game over screen
  • Prompts user if they want to play again
    • If user enters "No", program exits
    • If user enters "Yes", program will return with new word for user to guess

Instructions for Use

  1. Unzip the ruby_hangman folder from the zip file.
  2. Navigate to /ruby_hangman/src/ in the command-line and type in bundle install and press Enter to install dependancies.
  3. While in the same directory, type ruby index.rb into the command-line and press Enter to start the program.
  4. Enter yes or no if you would like to play the game.
  5. If you enter yes, the program will ask you to enter a username.
  6. You will see a number of lines _ _ _ _ _ that represent the number of letters in the word you have to guess.
  7. Guess what the word is by entering one letter at a time.
  8. Each correct letter will be revealed in the word.
  9. For each incorrect guess, you will lose a life. You only get 7 lives.
  10. Once you have finished the game, the program will prompt you for a yes or no if you would like to play again.

Screenshots

Welcome screen Hangman - Welcome screen

Choosing not play Hangman - Choosing not play

Guess a letter Hangman - Guess a letter

Incorrect guess Hangman - Incorrect guess

Inputs for guessing Hangman - Inputs for guessing

Guessing word Hangman - Guessing word

Game over screen Hangman - Game over screen

Game Over and Choosing not to play again Hangman - Game Over and Choosing not to play again

Game Over and Choosing to play again Hangman - Game Over and Choosing to play again

Winner screen Hangman - Winner screen

Winner and Choosing not to play again Hangman - Winner and Choosing not to play again

Winner and Choosing to play again Hangman - Winner and Choosing to play again

Design & Planning Process

Evidence of App Idea Brainstorming Sessions

Brainstorming ideas
Core Features and Stretch Goals
Draft sketch of user flow diagram

User/Workflow Diagram

User Workflow Diagram for Hangman app

Project Plan & Timeline

Project Plan and Timeline document
Initial pseudocode and text content for app

Screenshots of Trello Board

User Stories and Initial Ideas
Kanban Board on Trello