Skip to content

Tic-tac-toe is a paper-and-pencil game for two players, X and O, who take turns marking the spaces in a 3×3 grid. The player who succeeds in placing three of their marks in a horizontal, vertical, or diagonal row is the winner. The game was created using Ruby and it has a basic interface that runs in the terminal.

Notifications You must be signed in to change notification settings

AlanSoto31/tic-tac-toe-game-ruby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tic-tac-toe-game-ruby

Tic-Tac-Toe Game

Project created by Alan Soto Valle and Mir Rawshan Ali
It was based on the project in the Ruby Module in Microverse

Table of Contents

about tic-tac-toe

Tic-tac-toe is a paper-and-pencil game for two players, X and O, who take turns marking the spaces in a 3×3 grid. The player who succeeds in placing three of their marks in a horizontal, vertical, or diagonal row is the winner.


about the project

We created the game Tic Tac Toe using Ruby.

The game has a basic interface that runs in the terminal.

The goals of this project are:

  • Practice with OOP (Object Oriented Programming) using Ruby.
  • Learn how to create and structure a Ruby project.
  • Learn to manage the files with correct usage to make code maintainable.
  • Practice Git Flow and Github Flow creating branches for different features and for version control.
  • This is part of the Odin project curriculum https://www.theodinproject.com/courses/ruby-programming/lessons/oop

game-rules

  • Two player game
  • Player will have tokens or symbols (X or O)
  • Players take turns choosing a cell of the board to mark their symbol.
  • A player can only choose an empty cell if not will return an error until input is in an empty cell.
  • The first player to complete a succession of 3 of their assigned symbol (O's or X's) in a row, column or diagonal wins!
  • If all of the cells are filled with a symbol and no player matched 3 symbols, the game ends in a tie.

game-instructions

Once you run the game on the terminal, follow the instructions and prompts on screen.

  • Both players should enter their preferable name or nickname
  • Then it will display your tokens (X or O) and the turns will go accordingly to first and second player
  • After the board is displayed the player should input their token accordingly to the empty slot (1 to 9).

built-with

  • Ruby

setup-for-starting-tic-tac-toe

To get a local copy up and running follow these simple example steps.

prerequisites

Computer running Mac OS, Windows, or Linux Ubuntu. Internet browser: Firefox, Google Chrome, Opera...

Have Ruby installed you can see this link for more detailed instructions Install Ruby

installation

You MUST have Ruby installed in your system. If you don't have it installed you can go this page Install Ruby

After that install rspec by typing the command below:

gem install rspec

After installing ruby, you can download the repo or clone it (paste on the terminal) [email protected]:AlanSoto31/tic-tac-toe-game-ruby.git

run-tic-tac-toe

You will need to execute the main file located inside the bin folder. If you are using Window, follow next step.

windows

Open the terminal and navigate to the folder using cd path-to-folder containing the tic-tac-toe game. Once you are inside, your terminal should look like this: User//oop-ruby/. You can type or paste this on terminal bin/main to run the game.

mac-and-linux

Most Mac and some of Linux computers come with ruby installed, but still need to verify by typing in your terminal ruby --version if not please go back to Installation section.

After verifying you have ruby installed and completing the Installation section, open the terminal navigate using cd path-to-folder containing the tic-tac-toe game and run in the terminal bin/main to run the game.

how-to-test

In order to test our project type the command below:

rspec --format documentation

👥 authors

👤 Alan Soto

👤Mir Rawshan Ali

  • GitHub: @sumon0002009
  • Twitter: @sumon0002009
  • LinkedIn: Mir Rawshan Ali

👤Marcelo Araújo

🤝 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!

About

Tic-tac-toe is a paper-and-pencil game for two players, X and O, who take turns marking the spaces in a 3×3 grid. The player who succeeds in placing three of their marks in a horizontal, vertical, or diagonal row is the winner. The game was created using Ruby and it has a basic interface that runs in the terminal.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages