Pygame Tic Tac Toe

Run a Pygame Tic-Tac-Toe game with Minimax AI. Use when asked to play Tic-Tac-Toe, test game logic, or demonstrate Minimax algorithm with Pygame.

fnaith 9a442de 947 B Updated

File contents

Pygame Tic-Tac-Toe

A minimalist Tic-Tac-Toe game prototype using Pygame with a Minimax AI opponent.

Usage

Run the game:

python apps/pygame-tic-tac-toe/pygame-tic-tac-toe.py

Or use the batch file:

apps\pygame-tic-tac-toe\pygame-tic-tac-toe.bat

Arguments

Argument Choices Default Description
--first-player human, ai human Who plays first
--human-side X, O X Human plays as X or O
--log-level DEBUG, INFO, WARNING, ERROR INFO Logging verbosity

Controls

  • Click a cell to place your mark
  • Press R after game over to restart
  • Close window to exit

Requirements

  • Python 3.10+
  • Pygame 2.5+

fnaith/painting-goblin/tree/main/apps/mini-game/pygame-tic-tac-toe/skill commit 9a442de412

Frequently asked questions

npx skillmds@latest add fnaith/pygame-tic-tac-toe