Skip to content

SantiagoGuerra/tic-tac-toe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers Issues


Logo

Tic tac toe

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

View Demo · Report Bug · Request Feature

Table of Contents

About The Project

Product Name Screen Shot

This is the fifth project of the Microverse Ruby Section

This is also the first project of the Odin project (Ruby Project Programing: OOP)

Installation

If you want to install and play the game you need:

  • ruby installed in your computer
  • download or clone this repo
    • Clone over HTTPS:
     $ git clone https://github.com/SantiagoGuerra/tic-tac-toe.git
    
    • Clone over SSH:
     $ git clone ssh://[email protected]:SantiagoGuerra/tic-tac-toe.git
    
  • and execute bin/main.rb file

Game Rules

  1. The game is played on a grid that's 3 squares by 3 squares.
           1 | 2 | 3
	   - + - + -
	   4 | 5 | 6
	   - + - + -
	   7 | 8 | 9

  1. You can either be X or O, your friend would be the one you don't choose by default (if you choose X your friend will be O). Players take turns putting their marks in empty squares.
Your turn
           X | 2 | 3
	   - + - + -
	   4 | 5 | 6
	   - + - + -
	   7 | 8 | 9

Your friends' turn

           X | 2 | 3
	   - + - + -
	   4 | O | 6
	   - + - + -
	   7 | 8 | 9

  1. The first player to get 3 of her marks in a row (up, down, across, or diagonally) is the winner.
Winning combinations (W is equal to X or O)

   W | W | W       1 | 2 | 3	   1 | 2 | 3       W | 2 | 3       1 | W | 3	   1 | 2 | W       W | 2 | 3	   1 | 2 | W
   - + - + -	   - + - + -	   - + - + -	   - + - + -	   - + - + -	   - + - + -	   - + - + -	   - + - + -
   4 | 5 | 6	   W | W | W	   4 | 5 | 6	   W | 5 | 6	   4 | W | 6	   4 | 5 | W	   4 | W | 6	   4 | W | 6
   - + - + -	   - + - + -	   - + - + -	   - + - + -	   - + - + -	   - + - + -	   - + - + -	   - + - + -
   7 | 8 | 9	   7 | 8 | 9	   W | W | W	   W | 8 | 9	   7 | W | 9	   7 | 8 | W	   7 | 8 | W	   W | 8 | 9

  1. When all 9 squares are full, the game is over. If no player has 3 marks in a row, the game ends and nobody wins
for example: nobody wins

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

Built With

This project was built using these technologies.

  • Ruby
  • Rubocop
  • VsCode
  • Notepad++

Live version

You can see it working here

Contact

Santiago Guerra - @santi_gueam - @SantiagoGuerra - [email protected]

María Eugenia Quemé - @MaruKK - @euqueme - [email protected]

Project Link: [https://github.com/SantiagoGuerra/tic-tac-toe)

Acknowledgements

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages