Skip to content

This was a joint project between myself and eypsrcnuygr in which we built a completely CLI based game. It allows a user to play against a computer that randomly chooses a square in Tic-Tac-Toe.

Notifications You must be signed in to change notification settings

defoebrand/Tic-Tac-Toe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tic-Tac-Toe

This is a simple Tic-Tac-Toe game

Built With

  • Ruby
  • Rubocop
  • Ubuntu
  • Atom & VS Code

Live Demo

Here is the Live Demo Link

Prerequisities

To get this project up and running locally, you must already have ruby installed on your computer.

Getting Started

To get this project set up on your local machine, follow these simple steps:

To get your own copy of our project simply clone the repository to your local machine.

Step 1: Type the following command into a git shell

git clone https://github.com/eypsrcnuygr/Tic-Tac-Toe.git

Step 2: Direct a terminal into the cloned repository directory

cd Tic-Tac-Toe

Step 3: create an executable file by following the steps as outlined here

Step 4: type main.rb into the command line, open it in irb, or edit it in a text editor. If you chose to ignore step 3, type ruby bin/main.rb. Alternatively if you would like to skip all of these steps, just click the live demo above.

Rules of the game

Rule 1: The board is arranged in a grid from 1-9. The first row is 1-3, the second row is 4-6, and the third row is 7-9.

Rule 2: Players take turns selecting empty tiles.

Rule 3: The first player to fill 3 tiles in a row wins the game.

How to play

Step 1: After starting the program you will be prompted to choose either a human opponent or the cpu.

Step 2: Once an opponent is chosen, X's will go first (this will be you).

Step 3: Choose a position accordingly. After which, your opponent will do the same.

Step 4: Continue this process until either one player has 3 in a row or there are no squares left.

Step 5: The game will either declare a winner or end in a Cat's Game.

Authors

👤 Eyüp Sercan UYGUR

👤 Defoe Brandon

Repository Contents

bin folder: User interface instructions are contained in the main.rb file found in this folder. All user inputs and game outputs will be shown here.

lib folder: All game logic instructions are found between the game.rb file and player.rb files found in this folder. The game.rb file contains the board and instructions on how the program should declare a winner. The player.rb file creates the two players and instructs the program on how to handle each player's move.

🤝 Contributing

Contributions, issues and feature requests are welcome!

Show your support

Give a ⭐️ if you like this project!

Acknowledgments

  • This Project was part of an assignment available on The Odin Project.
  • Our thanks to Microverse and all our peers and colleagues there.

📝 License

This project is MIT licensed.

About

This was a joint project between myself and eypsrcnuygr in which we built a completely CLI based game. It allows a user to play against a computer that randomly chooses a square in Tic-Tac-Toe.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages