Skip to content

This repository contains the implementation of Tic-Tac-Toe game in C++ and Javascript.

Notifications You must be signed in to change notification settings

rathoresrikant/tic-tac-toe-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

Tic-Tac-Toe Game

  1. The C++ implementation of the tic-tac-toe game is for a N*N board. It is a console application which takes as input the board size. The game starts and the players have to enter the positions of the board where they want to mark their cross or circle. For each move, it is checked if the current player is the winner. A player wins if the board any row, column or diagonal of the board is filled with the symbol he has chosen. It is obvious that the winning move is part of the filled row, column or diagonal. The game results in a draw if the board is full and no row, column or diagonal has the same symbol. Click here to play the game.

  2. The Javascript implementation is for a 3*3 board. A form appears and the players enter their names and the game starts. The game is interactive and the player has to click on the board where he wants to fill his symbol. The rule of the game is same as above. HTML is used for markup ans CSS is used for styling. Try the game here.

  3. In the Play with System (basic) implementation, the opponent has not perfected the game. It still makes good moves. Firstly, it finds a square which will make it win. Secondly, it will block a winning move of the player. If the two possibilities are not there, it will just choose the first empty square in row-major order. Check this version of the game here.

Possible enhancements:

  1. Add an option to play with the system, which has perfected the game.
  2. Implement the ultimate tic-tac-toe game which has 9*9 board and is more advanced. Read more about it here

About

This repository contains the implementation of Tic-Tac-Toe game in C++ and Javascript.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published