This program is a Tic-Tac-Toe boardgame, which can be played in the terminal/console window; made in C.
Modes available to play:
- Human v/s Human.
- Human v/s A.I.
It comprises of various other functions, which control the various parts of the game. Although the two main ones being:
- func
human_vs_human()
- func
human_vs_ai()
It allows two humans to play against each other, each time the turn alternating.
Upon game over, it stops the game.
Initially, it offers a choice to the user.
Upon choice, The game starts accordingly.
If the AI has to make the first move, it makes a random move using the func random_pos()
.
Otherwise, it makes use of the minimax algorithm to find the best possible move.
The A.I. move is determined upon the use of the functions minimax()
and find_best_move()
.
P.S. You can't win against the A.I. 😉, it's either a draw, or a win for the computer.. Enjoy!
You are free to contribute for this repository!