A Ruby application, which allows the user to play Tic Tac Toe on the command line.
- Play a new game, or load a saved game
- Choose to play the following games:
- Human vs Human
- Human vs Computer
- Computer vs Computer
- Computer vs Human
- The computer player is unbeatable
- When a game has finished, opt to play another game or exit
- Save during the game
- Exit during the game
Note: if Ruby is not already installed, you can find instructions here.
git clone https://github.com/itsellej/ruby-tic-tac-toe
cd ruby-tic-tac-toe
bundle install
ruby lib/play.rb
The language used to create this application is Ruby.
The testing library used is RSpec. To run the tests, type rspec
in the terminal.
- Cases where the user is prompted to enter input again:
- Game type selection: if
'new'
or'existing'
is not entered - Loading a saved game: if the game name entered does not exist
- Player type selection: if
'h'
or'c'
is not entered - Move selection: if 1-9,
'save'
or'exit'
is not entered during game play
- Game type selection: if
- If the file containing the saved games is empty, a new game is automatically selected