https://github.com/vagyasri/hangman
In this Project, I have created the hangman game for practicing Ruby basics.
https://github.com/vagyasri/hangman
game ruby
Last synced: 10 months ago
JSON representation
In this Project, I have created the hangman game for practicing Ruby basics.
- Host: GitHub
- URL: https://github.com/vagyasri/hangman
- Owner: Vagyasri
- Created: 2021-05-26T16:47:14.000Z (about 5 years ago)
- Default Branch: Develop
- Last Pushed: 2021-05-31T14:08:38.000Z (about 5 years ago)
- Last Synced: 2025-05-30T20:45:49.329Z (about 1 year ago)
- Topics: game, ruby
- Language: Ruby
- Homepage:
- Size: 6.84 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README

# Tic-Tac-Toe
> We built a tic-tac-toe game on the command line where two human players can play against each other and the board is displayed in between turns.
> Tic-tac-toe is a game for two players, X and O, who take turns marking the spaces in a 3×3 grid. The player who succeeds in placing three of their marks in a diagonal, horizontal, or vertical row is the winner.
## Built With
- Ruby
- Rspec
## Getting Started
### To get a local copy run the following steps:
- [Copy this link](https://github.com/Vagyasri/Tic-Tac-Toe.git)
- Open your terminal or command line
- Run "git clone [Paste this link](https://github.com/Vagyasri/Tic-Tac-Toe.git)"
## How to set up tests
- Boot up your terminal and punch in "gem install rspec" to install RSpec
- You can verify your version of RSpec with "rspec --version"
- cd into project directory "Tic-Tac-Toe" and type "rspec --init" to initialize RSpec within the project
- This will generate two files, ".rspec" and "spec/spec_helper.rb"
- You can create the ruby test file inside the sprc directory (eg: logic_spec.rb, player_spec.rb)
## How to run tests
- You can simply run "rspec" in the terminal by cd into the directory in order torun the tests
- You can also run "rspec file-path" for the particular file you want to test from the directory
- You can run "rubocop" inorder to check the linter errors
## How to play "Tic-Tac-Toe"
- This game can be played between any two people.
- Run "ruby main.rb" in your terminal
- Initially, it will be asked to enter your names (for player 1 and player 2)
- You can enter minimum two characters of your name to move forward
- The first player will play with '❌' and the other with '⭕️'
- It will be player turnwise, Player 1 goes first, then Player 2, then again Player 1, likewise until you reach the following condition
- For winning this game, one has to create a row/column/diagonal of three '❌'s or '⭕️'s first
- If no one will be able to make so, it will be a tie and will ask for continuing another match or quit the game
#### Tip: If you're going first, then the best move you can make is to move into the center. This will maximize your chances of winning
### 🎊 🎉 Have fun 🎊 🎉
## Author
👤 **Bhagyashree Patra**
- GitHub: [@Vagyasri](https://github.com/Vagyasri)
- Twitter: [@Vagyasri](https://twitter.com/Vagyasri)
- LinkedIn: [Bhagyashree Patra](https://www.linkedin.com/in/bhagyashree-patra-029bb059/)
## 🤝 Contributing
Contributions, issues, and feature requests are welcome!
Start by:
- Forking the project
- Cloning the project to your local machine
- Run git checkout -b your-branch-name
- Make your contributions
- Push your branch up to your forked repository
- Open a Pull Request with a detailed description to the development branch of the original project for a review
Feel free to check the [issues page](https://github.com/Vagyasri/Tic-Tac-Toe/issues), contribute to the Project by creating an issue.
## Show your support
Give a ⭐️ if you like this project!