- There are two players in the game (X and O)
- Players take turns until the game is over
- A player can claim a field if it is not already taken
- A turn ends when a player claims a field
- A player wins if they claim all the fields in a row, column or diagonal
- A game is over if a player wins
- A game is over when all fields are taken
Build the business logic for a game of tic tac toe. It should be easy to implement a working game of tic tac toe by combining your code with any user interface, whether web or command line.
- Install gems using 'bundle install'
- Use 'rspec' to run tests with SimpleCov checking the coverage - coverage should be higher than 95%
- If all tests pass, run 'rubocop' to check the readability of code
- Code is structured in three classes
- Game class controls the players turns and where they place their pieces on the board
- Calculation class checks the array to see if the latest move resulted in a win
- Results class send the result of a winning turn back to Game to announce the winner