Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 830 Bytes

README.md

File metadata and controls

20 lines (14 loc) · 830 Bytes

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!