https://github.com/ternion-1121/tic-tac-toe
Simple, Two-Player, Tic-Tac-Toe game
https://github.com/ternion-1121/tic-tac-toe
game project pythonprogramming tic-tac-toe tic-tac-toe-game tictactoe tictactoe-game tictactoe-python
Last synced: about 2 months ago
JSON representation
Simple, Two-Player, Tic-Tac-Toe game
- Host: GitHub
- URL: https://github.com/ternion-1121/tic-tac-toe
- Owner: TERNION-1121
- Created: 2022-07-11T17:28:10.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-03T14:23:14.000Z (about 2 years ago)
- Last Synced: 2025-01-20T05:43:44.270Z (3 months ago)
- Topics: game, project, pythonprogramming, tic-tac-toe, tic-tac-toe-game, tictactoe, tictactoe-game, tictactoe-python
- Language: C
- Homepage:
- Size: 5.34 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
❌ Tic-Tac-Toe ⭕
This program is a Tic-Tac-Toe boardgame, which can be played in the terminal/console window; made in C.
Modes available to play:
1. Human v/s Human.
2. Human v/s A.I.
## func `main()`
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()`
### `human_vs_human()`
It allows two humans to play against each other, each time the turn alternating.


Upon *game over*, it stops the game.

### `human_vs_ai()`
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](https://en.wikipedia.org/wiki/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. :wink:, it's either a draw, or a win for the computer.. Enjoy!*
> You are free to contribute for this repository!