Tic-Tac-Toe game with a working AI.
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 35 commits ahead, 25 commits behind learn-co-students:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
config Done. Jun 5, 2016


Tic Tac Toe with AI


This is a CLI Tic Tac Toe game with a working Computer player.

There are 4 game modes: 0 Player, 1 Player, 2 Player and Wargames mode.

  • A 0 player game has two computer players playing against each other with no interaction from the user.
  • A 1 player game has a human playing against a computer.
  • A 2 player game has two human players.
  • For the wargames mode just type 'wargames' when prompted for the number of players, the computer will play 100 gmaes against each other, displaying the total tally of wins vs. draws at the end.


To play, clone this repository run bundle istall and then run ruby bin/tictactoe in your command line from the root directory.


This game has a test suite in the /spec directory. To run the test suite just run rspec in your terminal. To run only 1 of the files run rspec spec/[file_to_run].

This game was made as part of the Learn.co curriculum.

You can read the following 2 blog posts for some of my thoughts on coding this game:


puts Solution

You can read more about my journy at blog.yechiel.me or learn more about me and get in touch at yechiel.me