Shishir-1995 / Tic-Tac-Toe

tic-tac-toe is fun 2 player board game played on 3X3 board when getting you have to select three boxes either horizontally, diagonally or vertically

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tic-Tac-Toe

Tic-tac-toe is a two player game in which the objective is to take turns and mark the correct spaces in a 3x3 grid. Think on your feet but also be careful, as the first player who places three of their marks in a horizontal, vertical or diagonal row wins the game! How many rounds in a row can you win? You will be playing against a bot.

This is an Individual Project in which Min-Max Algorithm is implemented.

Features

  • Responsive Layout in all Devices
  • Quick Bot Play

Tech-Stack: HTML | CSS | JAVASCRIPT

Glimpses

Choice


This is where you will be selecting your side and by default you play as Player 1. So whatever color you choose, Bot is going to choose the other one and play. In a board game, it is always advantageous to play as Player 1.

square


You start on a blank board and its turn-by-turn based gameplay. One piece of advice to you is to choose such square which has highest squares connected so that you have many options to choose from on later stage

Result


Result are shown as a alert tag.

Min-Max Algorithm

  • Min-max algorithm is a recursive or backtracking algorithm which is used in decision-making and game theory. It provides an optimal move for the player assuming that opponent is also playing optimally.
  • Min-Max algorithm uses recursion to search through the game-tree.
  • Min-Max algorithm is mostly used for game playing in AI. Such as Chess, Checkers, tic-tac-toe, go, and various tow-players game. This Algorithm computes the minimax decision for the current state.
  • In this algorithm two players play the game, one is called MAX and other is called MIN.
  • Both the players fight it as the opponent player gets the minimum benefit while they get the maximum benefit.
  • Both Players of the game are opponent of each other, where MAX will select the maximized value and MIN will select the minimized value.
  • The minimax algorithm performs a depth-first search algorithm for the exploration of the complete game tree.
  • The minimax algorithm proceeds all the way down to the terminal node of the tree, then backtrack the tree as the recursion.


Do Checkout the Game

Tic-Tac Toe Game

About

tic-tac-toe is fun 2 player board game played on 3X3 board when getting you have to select three boxes either horizontally, diagonally or vertically


Languages

Language:JavaScript 65.2%Language:HTML 22.0%Language:CSS 12.8%