Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mykbit/tic-tac-toe-game-c-gui
This is a tic-tac-toe game with core game mechanics written in C and GUI written with the help of GTK3 library.
https://github.com/mykbit/tic-tac-toe-game-c-gui
c gtk3 gui-application minimax tic-tac-toe tictactoe
Last synced: about 1 month ago
JSON representation
This is a tic-tac-toe game with core game mechanics written in C and GUI written with the help of GTK3 library.
- Host: GitHub
- URL: https://github.com/mykbit/tic-tac-toe-game-c-gui
- Owner: mykbit
- License: mit
- Created: 2023-05-18T05:15:56.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-05T05:50:59.000Z (9 months ago)
- Last Synced: 2024-10-14T00:06:53.859Z (3 months ago)
- Topics: c, gtk3, gui-application, minimax, tic-tac-toe, tictactoe
- Language: C
- Homepage:
- Size: 46.9 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Tic Tac Toe with GUI
This is a Tic Tac Toe game written in C with GUI using GTK+3. The game offers 3 game modes: Player vs Player, Player vs Computer and Player vs Computer (Impossible Mode). The game is played on a 3x3 board. The player who succeeds in placing three of their marks in a horizontal, vertical, or diagonal row is the winner. GTK3 library provides a clear graphical interface and allows to play the game with a mouse.## Game Modes
### Player vs Player
In this mode, two players play against each other. The first player is X and the second player is O. The players take turns placing their marks on the board until one of them wins or the board is full.### Player vs Computer
In this mode, the player plays against the computer. The player is X and the computer is O. The player can choose who starts the game. The player and computer take turns placing their marks on the board following the same rules as in the Player vs Player mode. It is worth noting that the computer is using a simplified version of the minimax algorithm to determine the best move, which allows for faulty moves.### Player vs Computer (Impossible Mode)
This mode is identical to the Player vs Computer mode, except that the computer is using a full implementation of the minimax algorithm to determine the best move. The computer will never lose in this mode. Don't believe me? Try it yourself!## Setup
```
brew install gtk+3 && brew install pkg-config
```
## Build and Interact1. Navigate to the project directory:
```
cd path/to/Tic-Tac-Toe-Game-C-GUI
```2. Build the game:
```
make all
```3. Run the game:
```
./build/tic-tac-toe
```4. Choose the game mode.
5. Open the game window and play!
## Comments
You can find comments to the code in .h files.
## Gameplay