Skip to content

A smart Tic Tac Toe opponent that uses the Minimax algorithm

Notifications You must be signed in to change notification settings

aexzhou/TicTacToeMinimax

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smart Tic Tac Toe Opponent using the Minimax algorithm

About

This repository contains a simple implementation of a tic-tac-toe game using both Python and C++. You will play against the computer, who plays the best move according to the minimax algorithm. The stucture of the code itself is separated into two classes:

  • A TicTacToe class that handles all the game logic.
  • A Screen class that 'fakes' GUI handling and prints stuff to the terminal.

The method minimax under the TicTacToe class is where all the magic happens.

Gameplay

  1. The game starts off by allowing you to "flip a coin" and determine who goes first.
  2. Place your moves by entering positional numbers into the terminal according to the reference shown on screen.

  1. Good luck have fun!

About

A smart Tic Tac Toe opponent that uses the Minimax algorithm

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages