This repository contains three simple 2D games implemented in the C programming language. Each game is designed to be beginner-friendly and provides a fun way to learn and practice C programming concepts.
-
Guessing Game
- Description: A number guessing game where the player tries to guess a randomly generated number within a certain range.
- Objective: Guess the correct number within the given attempts while receiving hints about whether the guessed number is too high or too low.
-
Tic-Tac-Toe
- Description: A classic game where two players take turns marking X or O on a 3x3 grid.
- Objective: Place three marks in a horizontal, vertical, or diagonal row to win the game. The game ends in a draw if all cells are filled and no player wins.
-
Snake Game
- Description: A game where the player controls a snake that grows longer by eating food and must avoid hitting the boundary or its own body.
- Objective: Eat food to grow the snake's length and earn points. The game ends if the snake collides with the boundary or its own body.
To compile and run each game, follow the instructions provided in their respective folders.
-
Navigate to the desired game's folder (e.g.,
guessing_game
,tic_tac_toe
,snake_game
). -
Compile the C source code using a C compiler. For example:
gcc game.c -o game
- Run the compiled executable:
- For Windows:
game.exe
- For Linux/Mac:
./game
- Follow the on-screen instructions to play the game.
You can customize the games or contribute to their improvement by modifying the source code. Feel free to explore the code and experiment with different features or gameplay enhancements.
If you have any ideas, suggestions, or bug fixes, contributions are welcome! Fork the repository, make your changes, and submit a pull request.
This project is licensed under the MIT License.
These games were inspired by various classic games and programming tutorials.