Skip to content

iamthewalrus67/tic-tac-toe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tic Tac Toe

Author: Bohdan Ruban

Tic Tac Toe written in C++

Prerequisites

  • CMake
  • Make
  • C++ Compiler
  • fmt

Compilation

$ mkdir build
$ cd build
$ cmake ..
$ make

Usage

After compilation there should be a binary file named tic_tac_toe.

Here is an example of running this game with two Minimax AIs against each other:

$ ./tic_tac_toe
h - human, cr - computer, using random, cm - computer, using minimax.
Choose player 1:
cm
h - human, cr - computer, using random, cm - computer, using minimax.
Choose player 2:
cm
|1|2|3|
|4|5|6|
|7|8|9|
Enter a number from 1 to 9 to choose a corresponding cell on the board.

First player's turn:
|X|_|_|
|_|_|_|
|_|_|_|

Second player's turn:
|X|_|_|
|_|O|_|
|_|_|_|

First player's turn:
|X|X|_|
|_|O|_|
|_|_|_|

Second player's turn:
|X|X|O|
|_|O|_|
|_|_|_|

First player's turn:
|X|X|O|
|_|O|_|
|X|_|_|

Second player's turn:
|X|X|O|
|O|O|_|
|X|_|_|

First player's turn:
|X|X|O|
|O|O|X|
|X|_|_|

Second player's turn:
|X|X|O|
|O|O|X|
|X|O|_|

First player's turn:
|X|X|O|
|O|O|X|
|X|O|X|

Tie!

Results

A simple Tic Tac Toe game with an implemented Minimax algorithm and an ability to easily add new algorithms.

About

Tic Tac Toe written in C++

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published