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
- Host: GitHub
- URL: https://github.com/maheshkumar-novice/hangman
- Owner: Maheshkumar-novice
- Created: 2021-08-27T02:03:46.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-08-31T09:08:09.000Z (almost 5 years ago)
- Last Synced: 2025-07-06T22:07:44.699Z (about 1 year ago)
- Topics: files, oops, ruby, serialization
- Language: Ruby
- Homepage: https://replit.com/@MaheshkumarP/Hangman
- Size: 3.93 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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
## 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

## 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)