/tictactoe

A small game exercise

Primary LanguageRuby

tictactoe

Thanks for taking a look at my attempt at creating a tic-tac-toe game.

As per the instructions there was a limited time to spend on this exercise, so my focus was to get the basic interactions working. There are a number of improvements that come to mind:

  • Tests. It would be much easier to check that the game is doing what it should with even a basic suite of tests.
  • The computer is not smart at all. It should preferably know that it's better to pick the center and corners, and the basics of blocking.
  • When the game ends you're asked if you want to play again. When saying yes you should be remembered by the friendly computer opponent.
  • The board would be better split into its own function to keep TicTacToe concerned about the game only

To run the game:

ruby ttt.rb