An open API service indexing awesome lists of open source software.

https://github.com/maheshkumar-novice/hangman

A command line game written in Ruby
https://github.com/maheshkumar-novice/hangman

files oops ruby serialization

Last synced: 12 months ago
JSON representation

A command line game written in Ruby

Awesome Lists containing this project

README

          

# [Hangman](https://en.wikipedia.org/wiki/Hangman_(game))
This project is part of the [The Odin Project](https://www.theodinproject.com/paths/full-stack-ruby-on-rails/courses/ruby-programming/lessons/hangman)'s Ruby curriculum.

Table Of Contents



  1. Description


  2. Demo


  3. Built With


  4. Play Online


  5. Play Local


  6. What I Learned


  7. Acknowledgements

## Description
This implementation of **Hangman** played between a human and the computer. Computer will choose a word which will be between 5 to 12 characters. User needs to guess the word one letter at a time within the given number wrong attempts. If the user guess the word within the constraint then the user will be the winner. Else the computer is the winner. You can save the game with the particular file name with the 'save' input at anytime while playing and load it when the game starts. You can exit the game while playing with the 'exit' input.

## Demo
![Demo](./assets/demo.gif)

## Built With
* Ruby

## Play Online
[Replit](https://replit.com/@MaheshkumarP/Hangman)

## Play Local
### prerequisites
You need to have Ruby installed locally. If you don't have, use [this](https://www.theodinproject.com/paths/full-stack-ruby-on-rails/courses/ruby-programming/lessons/installing-ruby-ruby-programming) to install Ruby first.
### installation
```sh
git clone git@github.com:Maheshkumar-novice/Hangman.git
```
```sh
cd Hangman
```
```sh
ruby main.rb
```

## What I Learned
* How to think in OOP way
* How to use Ruby Heredoc
* How to manipulate files with Ruby
* How to serialize and deserialize to and from YAML in Ruby
* How to execute system command with `system()` in Ruby

## Acknowledgements
* [The Odin Project](https://theodinproject.com)
* [Replit](https://replit.com)

[Move To Top](#hangman)