Skip to content

SoumyadeepDas-2004/Tic-Tac-Toe-game-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tic-Tac-Toe-game-

Play Tic-Tac-Toe in Python! Includes user-friendly gameplay for 2 players or against the computer.

Tic-Tac-Toe Game (Multiplayer/Single Player with Minimax AI)

This is a Python-based Tic-Tac-Toe game that allows both multiplayer and single-player modes. In single-player mode, the player competes against the computer, which uses the Minimax algorithm to make optimal moves.

Features

  • Multiplayer mode: Play against a friend on the same device.
  • Single-player mode: Play against the computer with AI powered by the Minimax algorithm.
  • Terminal-based interface: The game runs in the command line/terminal.
  • Optimal AI: In single-player mode, the AI makes the best possible moves using Minimax to ensure it doesn’t lose.

Installation

  1. Clone this repository to your local machine.

  2. Ensure you have Python 3 installed.

  3. No additional libraries are required for this project as it only uses built-in Python modules.

How to Play

Multiplayer Mode

  • The game will prompt each player to input their move (row and column) on the board.
  • Players alternate turns, and the first one to align three marks (either 'X' or 'O') wins.

Single-player Mode (Player vs Computer)

  • The player will input their move (row and column), and then the AI will make its move using the Minimax algorithm.
  • The AI will always attempt to make the best possible move, and it's nearly impossible for the player to win if playing optimally.

Example

When running the game in single-player mode, the game interface will look like this:

Tic-Tac-Toe Screenshot

About

Play Tic-Tac-Toe in Python! Includes user-friendly gameplay for 2 players or against the computer.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages