An open API service indexing awesome lists of open source software.

https://github.com/sumitst05/tic_tac_toe_cpp

A Tic Tac Toe game made in C++. Featuring undefeatable AI opponent (You can draw against it)
https://github.com/sumitst05/tic_tac_toe_cpp

Last synced: over 1 year ago
JSON representation

A Tic Tac Toe game made in C++. Featuring undefeatable AI opponent (You can draw against it)

Awesome Lists containing this project

README

          

# ❌ Tic_Tac_Toe_cpp ⭕

This is a simple command-line Tic Tac Toe game written in C++.
- Has Single & Multi Player options.
- Can select different characters as Marker in Multi-Player option.
- Includes Invalid-Input flags (Program won't fall in an infinite loop if character is entered in buffer whe asked for integer or vice-cersa)
- Implements Minimax Algorithm so the computer is able to make the best moves!!

## Installation

1. Clone the repository:
```bash
git clone https://github.com/sumitst05/Tic_Tac_Toe_cpp.git
```
2. cd into Tic_Tac_Toe_cpp directory:
```bash
cd Tic_Tac_Toe_cpp
```
3. Compile and Run the code using g++:
```bash
g++ -o Tic_Tac_Toe Tic_Tac_Toe.cpp && ./Tic_Tac_Toe
```
(or you can use an IDE)

## How To Play

- Start the game
- Select [S]ingle / [M]ulti-Player option.
- Single Player:
- Take turns and play with the computer (Computer is actually smart now with the implementation of Minimax Algorithm)
- Multi Player:
- Select the marker for each player
- Take turns entering moves by typing numers from 1 to 9 to place your symbol there.

## Contributing

If you find a bug or have an idea for a new feature, feel free to open an issue or submit a pull request.

## License

This project is licensed under the [MIT License](LICENSE)