Skip to content

3 simple 2D games implemented in the C programming language.

Notifications You must be signed in to change notification settings

s-shemmee/Basic-2D-C-Games

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 

Repository files navigation

Basic 2D C Games

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.

Games

  1. 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.
  2. 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.
  3. 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.

Getting Started

To compile and run each game, follow the instructions provided in their respective folders.

  1. Navigate to the desired game's folder (e.g., guessing_game, tic_tac_toe, snake_game).

  2. Compile the C source code using a C compiler. For example:

gcc game.c -o game
  1. Run the compiled executable:
  • For Windows: game.exe
  • For Linux/Mac: ./game
  1. Follow the on-screen instructions to play the game.

Customization and Contribution

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.

License

This project is licensed under the MIT License.

Acknowledgements

These games were inspired by various classic games and programming tutorials.

About

3 simple 2D games implemented in the C programming language.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages