/tic-tac-toe

Ruby implementation of tic-tac-toe for N * N Grid

Primary LanguageRuby

Tic tac toe Build Status Code Climate Test Coverage

<img src="https://raw.githubusercontent.com/ankit8898/tic-tac-toe/master/images/ttt.png" width="200" height="200""/>

Features

  • Play against computer
  • Flexible Grid size. For N * N grid. Don't stop your self to a 3 * 3 . 😎
  • Declares Winner

Algorithm used

There are various implementation available over the web for tic tac toe and for N * N Implementation. But, i haven't used them .

The winner of the Grid can be any time decided if

  • We have one of the winning pattern in a Row

<img src="https://raw.githubusercontent.com/ankit8898/tic-tac-toe/master/images/row.jpg" "/>

  • We have one of the winning pattern in a Column

<img src="https://raw.githubusercontent.com/ankit8898/tic-tac-toe/master/images/column.jpg" "/>

The Alogorithm scans all 3 combinations after every move.

Getting running

$ bundle install
$ bundle exec rake play #starts the game

Interface

  1. Interactive terminal

Alt text

  1. Declares winner 👏

Alt text

Testing

We use Rspec for testing ❤️

Alt text

Run tests via

$ bundle exec rspec