Skip to content

snippet-com/MiniMax-TicTacToe-Engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tic Tac Toe AI Project

This small Python project implements a Tic-Tac-Toe game with a Minimax-based AI. The code is structured as a set of modules exposing simple APIs so you can import functions from other code or run the game interactively.

Structure

  • board_api.py – board utilities (create, place, undo, winner check, etc.)
  • ai_api.py – AI logic including minimax and compute_best_move
  • game_api.py – higher‑level helpers for running the game and moves
  • main.py – CLI entry point (python main.py to start)
  • tests/test_game.py – basic pytest suite verifying core behaviors

Usage

# run the game
py main.py

# run tests
py -m pytest tests/test_game.py

The AI returns the best move as (row, col) and can be invoked from other code via from ai_api import compute_best_move.

Extending

You can build a GUI or web frontend by calling the API functions above. The logic is isolated from the user interface for easy reuse and testing.

About

Tic Tac Toe AI implemented using the Minimax search algorithm. This project demonstrates game state evaluation, recursive decision-making, and optimal move selection using adversarial search.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages