A console-based Tic Tac Toe game developed in C, implementing structured programming and game logic using arrays and modular design.
This project demonstrates strong fundamentals in C programming, control flow, functions, and basic game logic implementation.
Tic Tac Toe is a two-player console game where players take turns marking spaces in a 3×3 grid.
The game validates user input, updates the board dynamically, and checks for winning or draw conditions after every move.
This project focuses on implementing clean logic, modular design, and proper input validation in C.
- Implement a classic 3×3 Tic Tac Toe game in C
- Practice control structures and conditional logic
- Apply functions for modular code design
- Improve logical thinking and game-state handling
- Two-player gameplay (Player X and Player O)
- Real-time board display after each move
- Input validation to prevent invalid or repeated moves
- Win detection (rows, columns, diagonals)
- Draw condition detection
- Clean and simple console interface
- C++ Programming
- Arrays (2D Array for Board)
- Functions
- Loops and Conditional Statements
- Input Validation
- Game Logic Implementation
- The game board is represented using a 2D character array (3×3).
- Players take turns entering positions (1–9).
- The program checks:
- If the move is valid
- If the player has won
- If the game ends in a draw
- The board is updated dynamically after each move.
TicTacToe/
├── main.c
├── game.c
├── game.h
└── README.md
gcc *.c -o tic_tac_toe./tic_tac_toe| TIC | TAC | TOE |
|---|---|---|
| 1 | 2 | 3 |
| 4 | 5 | 6 |
| 7 | 8 | 9 |
| TIC | TAC | TOE |
|---|---|---|
| 1 | 2 | 3 |
| 4 | X | 6 |
| 7 | 8 | 9 |
| TIC | TAC | TOE |
|---|---|---|
| 1 | O | 3 |
| 4 | X | 6 |
| 7 | 8 | 9 |
The program checks for:
- All rows matching
- All columns matching
- Both diagonals matching
If no winning condition is met and all positions are filled, the game is declared a draw.
This project strengthened my understanding of:
- Array manipulation
- Control flow and conditional logic
- Modular programming using functions
- Real-time game-state validation
It improved my ability to design structured and interactive console-based applications.
Manu H P
Embedded Systems Enthusiast
Strong in C Programming, Data Structures, and Linux Internals
This project is developed for learning and educational purposes.