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

https://github.com/abeidahmed/tic-tac-toe

This is the ruby version of the popular TicTacToe game.
https://github.com/abeidahmed/tic-tac-toe

Last synced: 3 months ago
JSON representation

This is the ruby version of the popular TicTacToe game.

Awesome Lists containing this project

README

        

# TicTacToe

> This is the ruby implementation of the popular TicTacToe game.

## What is TicTacToe?

Tic-tac-toe (American English), noughts and crosses (Commonwealth English), or Xs and Os/“X’y O’sies” (Ireland), is a paper-and-pencil 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. It is a solved game with a forced draw assuming best play from both players. - from [Wikipedia](https://en.wikipedia.org/wiki/Tic-tac-toe)

![TicTacToe game screenshot](https://github.com/abeidahmed/tic-tac-toe/blob/game-instructions/assets/screenshot.png)

## Table of contents

- [Setup](#setup)
- [Test](#test)
- [Game instructions](#game-instructions)
- [Built with](#built-with)
- [Authors](#authors)
- [Contributing](#contributing)
- [Show your support](#show-your-support)
- [License](#license)

## Setup

- Download or clone the repo: `https://github.com/abeidahmed/tic-tac-toe.git`
- `cd` into the directory
- Run `git checkout -b development`
- Next run `git pull origin development`
- Finally, run `bin/main.rb` or `ruby bin/main.rb`

## Test

- Setup the project by following the above steps
- Run `bundle exec guard` to automatically run the `spec` files on file change, or
- Run `bundle exec rspec spec/*{filename}` to run the `spec`s manually

## Game instructions

- After downloading and setting up, run the game using the above instructions.
- As the file is executed you will be asked to enter your name. Same goes for your friend.
- After that you'll be presented with the TicTacToe box as seen in the above screenshot.
- Enter any number from 1 to 9.
- Player turns are switched between you and your friend until and unless the game finishes.
- The game finishes when either you or your friend wins, or results in a draw.
- A player wins if the mark (x or o) is horizontally, vertically or diagonally aligned.
- That is it. Enjoy playing.

## Built with

![Ruby](https://img.shields.io/badge/ruby-%23CC342D.svg?&style=for-the-badge&logo=ruby&logoColor=white)

## Authors

👤 **abeidahmed**

- GitHub: [@abeidahmed](https://github.com/abeidahmed)
- Twitter: [@iamhawaabi](https://twitter.com/iamhawaabi)
- LinkedIn: [Abeid Ahmed](https://www.linkedin.com/in/abeid-ahmed-b21882172/)

## Contributing

Contributions, issues, and feature requests are welcome!

- Fork the project
- Create your feature branch `git checkout -b awesome-feature`
- Commit your changes `git commit -m 'Awesome feature'`
- Push it `git push -u origin awesome-feature`
- Open a pull request using this branch

## Show your support

Give a ⭐️ if you like this project!

## License

Copyright 2020 Abeid Ahmed. [MIT](https://github.com/abeidahmed/tic-tac-toe/blob/development/LICENSE) licensed.