Skip to content

euqueme/tic-tac-toe

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers Issues Hireable


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)

Built With

This project was built using these technologies.

  • Ruby
  • Rspec
  • Rubocop
  • VsCode
  • Notepad++

Live Version

You can see it working here

Usage

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/euqueme/tic-tac-toe.git
    
    • Clone over SSH:
     $ git clone ssh://[email protected]:euqueme/tic-tac-toe.git
    
  • and execute bin/main.rb file

Automated Test

To run the test you need to cd into the tic-tac-toe diretory and run:

rspec spec/

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 will take the opposing sign by default (in other words, if you choose X, your friend will be O). Players take turns placing 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

Author

👤 María Eugenia Quemé

👤 Santiago Guerra

🤝 Contributing

Contributions, issues and feature requests are welcome!

Feel free to check the issues page.

Show your support

Give a ⭐️ if you like this project!

Acknowledgements

About

Famous Tic Tac Toe console game made with Ruby, Rubocop, Rspec

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%