Skip to content

adamclasic/tictactoe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers Issues Run on Repl.it


Logo

Tic Tac Toe

This project is part of the Microverse curriculum in Ruby module!
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents

About The Project

Product Name Screen Shot

This is the third project of the Microverse Ruby Module

This is also the first project of the Odin project curriculum

Installation

To play this game you need to:

  • have ruby installed in your computer
  • download or clone this repo:
    • Clone with SSH:
      git@github.com:adamclasic/tictactoe.git
    
    • Clone with HTTPS
      https://github.com/adamclasic/tictactoe.git
    
  • and execute bin/main.rb file using your terminal

Game Rules

  • This is a customized version of the original tic-tac-toe game. The basic rules remain unchanged, the tokens to play with have changed instead.

  • The game is played on a 3 by 3 grid

    X  |   X   |   X    
  ----------------------
    X  |   O   |   O    
  ----------------------
    X  |   X   |   X      
  • In this game, there are only two letters to play with 'X' and 'O'. Whichever player gets the first similar letters in an entire row, column or diagonal WINS!!!.
  • At the begining of the game, player 1 will choose either 'X' or 'O' and the other letter will be assigned to player 2 automatically.
  • Once the players both have letters to play with, they will use numbers 1 through 9 to select a position on the game board. for example:
      Player playing with 'X' enters position '2'.
    
          1   2   3  
        -------------
      1 |   | X |   | 3
        -------------
      4 |   |   |   | 6
        -------------
      7 |   |   |   | 9
        -------------
          7   8   9    
    
      Player playing with 'O' enter position '5'.
    
          1   2   3  
        -------------
      1 |   |   |   | 3
        -------------
      4 |   | O |   | 6
        -------------
      7 |   |   |   | 9
        -------------
          7   8   9   
    
    • The first player to get their letters in a row (up, down, across, or diagonally) wins e.g.
    
    
          X | O | O    X | X | X     X | O | O     O | O | O
         -----------  -----------   -----------  -----------
          X | X | O    O | O | O     X | X | O     O | X | O
         -----------  -----------   -----------  -----------
          X | X | X    X | X | X     O | O | O     O | X | O
    
    • When all squares are full and no player has won, then game ends in as a Draw e.g.

           O   |  X   |  O     
        ----------------------
           O   |  X   |  X    
        ----------------------
           X   |  O   |  O     
      

Built With

This project was built using these technologies.

  • Ruby
  • Rspec

Testing

If you wish to test it. Install Rspecwith gem install rspec. We used rspec 3.9.1 but any version not older than 3.0should work fine. Clone this repo to your local machine, cd into tictactoe directory and run rspec

Live version

You can see it working here

Contributors

👤 Phillip Musiime

👤 Abderrahmane Adam Allalou

Acknowledgements

📝 License

This project is MIT licensed.

About

a tic-tac-toe game on the command line where two human players can play against each other and the board is displayed in between turns.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages