Giter Club home page Giter Club logo

minimax_tictactoe's Introduction

Tic-Tac-Toe with Minimax Algorithm

This simple console-based and browser game allows you to play a Tic-Tac-Toe game against an AI opponent that uses the Minimax algorithm to make strategic moves.

Features

Player vs. AI gameplay with Minimax algorithm.
Command-line or browser interface for ease of use.
Minimalistic design for quick and straightforward gameplay.

Minimax Algorithm

The Minimax algorithm is a decision-making algorithm used in two-player games, such as Tic-Tac-Toe. It is used to determine the best possible move for a player,
assuming that the opponent is also playing optimally. The algorithm works by recursively exploring all possible moves in the game tree and assigning a score to each move.
The player chooses the move with the highest score (for maximizing player) or the lowest score (for minimizing player) at each level of the tree.
This process continues until a terminal state (win, loss, or draw) is reached, and the algorithm returns the best move.

Running the game with Command-line interface.

  1. Clone repository.
  2. Run the game with: 'python game.py'

Running the game with browser interface.

  1. Clone repository.
  2. Install node.js (nodejs.org).
  3. Run 'npm install' in frontend directory to install react dependencies.
  4. Run 'npm start' in frontend directory to start frontend server.
  5. Run 'pip install -r requirements.txt'
  6. Run 'uvicorn backend.main:app' on base directory to start backend server.
  7. Play.

Game Instructions

Use the numbers 1-9 (command-line) or click on the box (browser) to make a move on the Tic-Tac-Toe board.
The game will prompt you to enter your move during your turn.
The AI opponent will use the Minimax algorithm to make its moves.

minimax_tictactoe's People

Contributors

linhares06 avatar

Watchers

 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.