Coder Social home page Coder Social logo

hangman's Introduction

hangman

hangman: guessing game for one player

How to Play

Hangman is a word-guessing game where players try to guess a secret word one letter at a time. Here's how to play:

  1. Starting the Game:

    • To play the game, make sure you have Ruby installed on your system. Then, navigate to the directory containing the lib folder and run the following command:

      ruby lib/hangman.rb
  2. Options Menu:

    • Upon starting the game, you'll be presented with an options menu:
      =========================
      Welcome to Hangman Game!
          1 - New game
          2 - Load game
      =========================
      
  3. Choosing an Option:

    • Choose an option by entering the corresponding number and pressing Enter:
      • Enter 1 to start a new game.
      • Enter 2 to load a saved game from a file.
  4. New Game: If you choose to start a new game, a random secret word will be selected, and you'll begin guessing letters to uncover the word.

  5. Load Game: If you choose to load a saved game, you'll be prompted to enter the file name of the saved game. Make sure to provide the correct file path.

  6. Guessing Letters:

    • Once the game starts, you'll be prompted to guess a letter.
    • Enter a single letter (A-Z) and press Enter.
    • If the letter is correct, it will be revealed in the secret word. Otherwise, it will be counted as an incorrect guess.
  7. Winning or Losing:

    • Continue guessing letters until you either:
      • Successfully guess the entire word (You Win!), or
      • Run out of attempts (You Lose!).
  8. Saving the Game:

    • During the game, you'll have the option to save your progress by entering 1 when prompted.
    • The game state will be saved to a JSON file in the appdata directory.
  9. Ending the Game: The game will end once you win, lose, or choose to save and exit.

  10. Have Fun!: Enjoy playing Hangman and see how many words you can guess!

hangman's People

Contributors

andrecosta90 avatar

Watchers

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