Skip to content

Tic-Tac-Toe game created by using object oriented programming paradigm. It can be played by two player

Notifications You must be signed in to change notification settings

RaminMammadzada/ruby-tic-tac-toe-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Microverse Ruby Project #3

Tic Tac Toe game (with Object Oriented Programming)

screenshot

In this project we have recreated the well known Tic-Tac-Toe game by using object oriented programming paradigm. We had 5 milestones as below:

  • Miltestone 1 - Basic initial setups and linter configurations.
  • Miltestone 2 - CLI user interface is implemented.
  • Miltestone 3 - Game logic is implemented and the main user interface moved to Main class.
  • Miltestone 4 - Instructions and Rules for game
  • Miltestone 5 - Unit Tests with Rspec for classes and methods.

Game Rules

  • Two players can start game by entering their names
  • Player names should contain at least one letter
  • Game board consists of 3 by 3 grid and 9 locations.
  • x sign for game belongs to Player1 and o sign belongs to Player2
  • No player can put move in a place which is already filled
  • Game board will check if a player wins after every move
  • If no player wins it's a draw

Built With

  • Ruby,
  • Rubocop

Live Demo

Live Demo Link

Run game

Besides the live demo link, you can run those functions in you own local environment.

Type ./bin/main.rb in the root file of the project.

You can also type ruby bin/main.rb in the root file of the project.

Run the tests

All public methods are tested with Rspec.

  • Open a terminal window and type rspec
  • All tests should be passed:

screenshot of tests

Dependency Installations

  • In order to run, you need to install RUBY in your computer. For windows you can go to Ruby installer and for MAC and LINUX you can go to Ruby official site for intructions on how to intall it. Then you can clone the project by typing git clone https://github.com/RaminMammadzada/ruby-tic-tac-toe-game/tree/develop

  • The game was tested using RSpec which is a ruby testing tool.

    • In a terminal window type gem install rspec
    • Once rspec install has finished, go to project directory and type rspec --init
    • You will see a folder spec and a file .rspec
    • Inside spec folder you'll see a spec_helper.rb file.

Authors

👤 Ramin Mammadzada

👤 Sajjad Ahmad

👤 Abdellani Youcef

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

Acknowledgments

  • Microverse
  • Odin project

📝 License

This project is MIT licensed.

About

Tic-Tac-Toe game created by using object oriented programming paradigm. It can be played by two player

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages