Skip to content

Tic Tac Toe Game using minimax algorithm and real-time Socket.IO Flask

Notifications You must be signed in to change notification settings

ArunHarish/tic-tac-toe-game-minimax

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tic-tac-toe-game-minimax

  • This is an implementation to showcase minimax algorithm using its classic application on tic tac toe (Noughts and Crosses) game.

  • The algorithm works by minimising the possible loss caused by the opponent, whose goal is to maximise the opportunity to win the game.

  • Uses React SPA for GUI, and the Flask server running this algorithm for game decision.

Preview

Preview
Gameplay of the player vs AI

Technology Used

Back-end

  • Python
    • Flask
    • Socket-IO

Front-end

  • React (Class Components)
  • Axios
  • Socket-IO client

Build

Front-end

  • Navigate to the static-src folder and run npm install to get all the dependencies
  • Create the build using npm run build

Back-end

  • Firstly create a virtual environment using virtualenv env
    you can use any name, but you get the idea.
  • Activate your virtual environment using source env/bin/activate
  • Navigate to the root directory and install all the dependencies using pip install -r requirements.txt
  • Then run the server: python server.py
    NOTE: This might take some time, depending on your hardware spec, since the server must load the game tree containing all the possible moves.
  • Finally, using your favourite browser, go to http:https://localhost:5000 (the default port of Flask), and you should see the game running!

About

Tic Tac Toe Game using minimax algorithm and real-time Socket.IO Flask

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published