Skip to content

addod19/OOP_TicTacToe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Detailed Game instructions for TicTacToe Players

Introduction

  1. You probably already know how to play Tic-Tac-Toe. It's a really simple game, right? That's what most people think. But if you really wrap your brain around it, you'll discover that Tic-Tac-Toe isn't quite as simple as you think!

  2. Tic-Tac -Toe involves looking ahead and trying to figure out what the person playing against you might do next.

RULES FOR TIC-TAC-TOE

  1. The game is played on a grid that's 3 squares by 3 squares.

  2. You are X and your friend is O. Players take turns putting their marks in empty squares.

  3. The first player to get 3 of her marks in a row (up, down, across, or diagonally) is the winner.

  4. When all 9 squares are full, the game is over. If no player has 3 marks in a row, the game ends in a tie.

tictactoe

HOW CAN I WIN AT TIC-TAC-TOE?

  1. To beat the computer (or at least tie), you need to make use of a little bit of strategy. Strategy means figuring out what you need to do to win.

  2. Part of your strategy is trying to figure out how to get three Xs in a row. The other part is trying to figure out how to stop the computer from getting three Os in a row.

  3. After you put an X in a square, you start looking ahead. Where's the best place for your next X? You look at the empty squares and decide which ones are good choices—which ones might let you make three Xs in a row.

  4. You also have to watch where the computer puts its O. That could change what you do next. If the computer gets two Os in a row, you have to put your next X in the last empty square in that row, or the computer will win. You are forced to play in a particular square or lose the game.

  5. If you always pay attention and look ahead, you'll never lose a game of Tic-Tac-Toe. You may not win, but at least you'll tie.

How to play Tic Tac Toe in terminal

Clone the repository to your local machine

$ git clone https://github.com/addod19/OOP_TicTacToe.git

open your terminal

cd into the directory

$ cd OOP_TicTacToe

run ruby bin/main.rb

$ ruby bin.main.rb

You will be asked to enter your name, there the game begins. Follow the instructions on the terminal. Have fun enjoying the game

Milestone3 The Game Logic

This project is setup with linters and two folders :

  1. lib
  2. bin

The lib directory contains the files for the game logic The bin directory contains the file for the executable main.rb

This is a part of a series of projects undertaken by students of Microverse remote school for software developers.

Collaborators:

  1. Maya88en

  2. Daniel Larbi Addo

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages