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

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.

Awesome Lists containing this project

README

          

![](https://img.shields.io/badge/Microverse-blueviolet)

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