Coder Social home page Coder Social logo

defoebrand / tic-tac-toe Goto Github PK

View Code? Open in Web Editor NEW
7.0 0.0 1.0 29 KB

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.

Home Page: https://repl.it/@eypsrcnuygr/Tic-Tac-Toe#bin/main.rb

Ruby 100.00%
ruby repl tictactoe-game

tic-tac-toe's Introduction

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.

tic-tac-toe's People

Contributors

defoebrand avatar srjnnnn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.