A naive or creative ruby implementation of an unbeatable tic-tac-toe program. For a more scientific approach check out the article "Tic Tac Toe: Understanding The Minimax Algorithm".
- The program should allow three game modes:
- User vs. Computer
- User vs. User
- Computer vs. Computer
- The computer player should never lose
- The user can choose which player goes first
You should have any latest ruby version installed. To be sure you can check the listed version in the provided /.travis.yml.
git clone https://github.com/grekko/tic-tac-toe.git
cd tic-tac-toe
bundle install
./bin/tictactoe
Tests are written with rspec (/spec-Directory). Run them all with:
rake
Generate code coverage report or have a look at Codeclimate
open coverage/index.html
- Reconsider coupling between CLI <-> Game/Match