Coder Social home page Coder Social logo

cli-hangman's Introduction

Hangman Game

This is a simple Hangman game implemented in Ruby. It allows players to guess letters to uncover a hidden word within a limited number of attempts.

Installation

Prerequisites

  • Ruby installed on your system

Windows

  1. Ensure you have Ruby installed. If not, download and install it from here.
  2. Clone this repository to your local machine.
        git clone [email protected]:PeterG-ithub/cli-hangman.git
  3. Navigate to the directory where you cloned the repository.
        cd cli-hangman
  4. Run main.rb to start the game.
        ruby .\lib\main.rb  
    

Linux

  1. Open a terminal.
  2. Ensure you have Ruby installed by running ruby --version.
        ruby --version

If not, install Ruby using your package manager. ```bash sudo apt update sudo apt-get install ruby-full

  1. Clone this repository to your local machine.
        git clone [email protected]:PeterG-ithub/cli-hangman.git
  2. Navigate to the directory where you cloned the repository.
        cd cli-hangman
  3. Run main.rb to start the game.
        ruby lib/main.rb
    

Description

This Hangman game is implemented in Ruby and runs in the command-line interface. Players can choose to start a new game or load a saved game. The game randomly selects a word from a predefined list, and the player attempts to guess the word letter by letter. If the player guesses a letter correctly, it is revealed in the word. Otherwise, the player loses a guess. The game ends when the player correctly guesses the word or runs out of guesses.

Technologies Used

  • Ruby
  • JSON for serialization

Features

  • Start a new game or load a saved game
  • Randomly select a word from a predefined list
  • Allow the player to guess letters
  • Display the word with placeholders for unrevealed letters
  • Keep track of correct and incorrect guesses
  • Save game progress to resume later

Credits

This Ruby Project is part of the curriculum provided by The Odin Project, an open-source online platform that offers free resources to learn web development.

Demo

Demo

cli-hangman's People

Contributors

peterg-ithub avatar

Watchers

 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.